How to use escape char in a query?(s22)


I need to know what is escape character in oracle, I have a table which has
data in it with apostrophes.

'ants
so I can't do   (select  * from table  where col like  ' 'ant' ')



Ans1:

Try that
select  * from table  where col like  '''ant'''



Ans2:

Use double single quotes (aka apostrophes).  For example,
SQL> insert into mytable values ('''ant');
1 row created.

SQL> select * from mytable where mycol = '''ant';
mycol
-----
'ant
 

John.
 
 

Hosted by www.Geocities.ws

1