Friday, 16 February 2018

Toad Error OBJECT expected on line 1.




Following error occurs when Savedsql.dat file is corrupted. 


Solution of this error is RENAME Savedsql.dat file and start Toad again.

File location is 

C:\Program Files\Quest Software\Toad for Oracle\User Files

                    OR

C:\Users\SK\AppData\Local\VirtualStore\Program Files\Quest Software\Toad for Oracle\User Files

Sunday, 6 March 2016

How to display line numbers in oracle Sql developer ?

Solution:  follow the below steps –


Step 1: Go to start then open SQL Developer.
































Step 2: In SQL Developer under  Tools then click on Preferences.





















Step 3: In Preferences dialog window, expand Code Editor and select Line Gutter.


























Step 4: In Line Gutter item, check Show Line Numbers from right side window and click Ok 
button.


Your SQL Developer interface will display the line number while writing SQL queries.
(Below screen shot for reference)

Please share your in case of any further clarification on above post.

Friday, 4 March 2016

Difference between DELETE, TRUNCATE and DROP commands ......................



DELETE

  •   DELETE is a DML command
  •   DELETE   command is use to remove rows from a table.
  •   COMMIT or ROLLBACK is necessary after performing DELETE operation commend because DELETE is a DML command.
  •   WHERE clause can be used in DELETE operation for removing some rows from a table.
  •   Only rows of table is remove not structured.

TRUNCATE

  •    TRUNCATE is a DDL command.
  •    TRUNCATE remove all rows from table,this is faster than DELETE.
  •   COMMIT or ROLLBACK is not use while performing TRUNCATE commend because  DDL command.
DROP

  •    DROP is a DDL command.
  •   DROP remove table from the database (remove data & structure of table).
  • COMMIT or ROLLBACK is not use 

Thursday, 3 March 2016

What is Substitution Variable in Oracle



Substitution variable is a user variable name preceded by ampersands (&) .


Use of Substitution Variable(&)
Example:

Create table test1 (id number, name varchar2 (50), job varchar2 (50), mobile number);

Insert into test1 values (1,'vinod','gov',9453534145);
Insert into test1 values (2,'ashu','gov',9453534148);
Insert into test1 values (3,'rahul','priv',9453534172);                    
Insert into test1 values (4,'solhu','self',9453539158);
Insert into test1 values (5,'pradep','priv',9456534148);
Insert into test1 values (6,'mishra','gov',9453538148);
Insert into test1 values (7,'pal','self', 9453536448);    

in this example enter id at run time .
if set verify off   then old & new not show 

In above example two variable is used table_name and enter_id



    

Saturday, 2 January 2016

Difference between view and materialized view.............

  VIEW :

  1. The view will not store any data.
  2. The view is mainly use for the security purpose.
  3. In view whenever the base table is dropped the view will not be accessible. 
  4. In view DML operation can perform.(on simple views)
MATERIALIZED VIEW :

  1. The materialized view will store the data.
  2. The materialized view is mainly use for the performance purpose.
  3. In materialized view whenever the base table is dropped the view will accessible.
  4. In materialized view DML operation can not perform. 












Please share your in case of any further clarification on above post.

Wednesday, 23 December 2015

What is oracle Functions ?

Functions

These are oracle predefined functions ,which are used in sql statements.

Functions are two types:
 - Single Row Functions
 - Group Functions

Single Row Functions :

Single Row Functions different type some type are described below:

1. String Functions
2. Date Functions
3. Numeric Functions
4. Conversion Functions
5. Miscellaneous Functions
 
1. String Functions :

a. INITCAP : This is use to Capitalized first latter of a string.
Ex. Sql > select initcap('hello world') from dual;
output>
                 

b. UPPER : This is use to convert  a string into upper case.
Ex. Sql > select upper('hello world') from dual;
output>
           
c. LOWER : This is use to convert  a string into lower case.
Ex. Sql > select lower('HELLO world') from dual;
output>
            
d. LENGTH : This function is use to find length of a string.
Ex. Sql >select length('HELLO world') from dual;
output>
           

e. RPAD: This function is use to pads the right-side of a string  with a specific character or a set of characters (Default padding character is blank space)
Ex. Sql> select rpad('hello',9,'$'), rpad('hello',9,'$#') from dual;
output>
          


f. LPAD :This function is use to lads the left-side of a string  with a specific character or a set of characters  (Default padding character is blank space)
Ex. Sql> select lpad('hello',9,'$'), lpad('hello',9,'$#') from dual;
output>
          

g. LTRIM :This function is use to remove string's character from left side of the srting.
Ex. Sql> select ltrim('12heloo123','12345'), ltrim('heloo123','12345') from dual;
output>
          


h. RTRIM :This function is use to remove string's character from right side of the srting.
Ex. Sql> select rtrim('12heloo123','12345'),rtrim('heloo123','12345') from dual;
output>
         
       

i. TRIM : This function is use to remove unwanted character from both side of the string.
    LEADING,TRAILING and BOTH are three parameter use in TRIM function.
    BOTH is default parameter.
Ex. Sql>  select trim(leading'1'from'12reo123'), trim(trailing'3'from'33reo123'), trim(both'3'from'33reo123'), trim('3'from'33reoo123')  from dual;
output>
           


NOTE: TRIM set have only one character can't use more than one character.


Please share your in case of any further clarification on above post.