Saturday 21 July 2012

Escape seqence in oracle queries

In oracle database queries '&' has special meaning, while inserting values to table if we give & symbol it will prompt for the input.
example:
insert into employee values(&id,&name,&salary);
It promptsn to enter those values.

If & symbol is there inside the column value then also it will prompt so to avoid that we use escape symbol.
example:
insert into employee(id,name,emil) values (12,'abcd&efg',xyz.gmail.com);

it will prompt like enter efg value. So to avoid this we use escape '\'
insert into employee(id,name,email) values(12,'abcd\&efg',xyz.gmail.com);


No comments:

Post a Comment