Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Help What is the SQLPLUS escape character ?
On Mon, 26 Apr 1999 17:49:57 GMT, "Seigmund Akinwande Johnson"
<asjohns_at_midway.uchicago.edu> wrote:
>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' ')
>
>SAJ
>
>
>
Have you tried this???
SQL> select * from test
2 /
COL1
SQL> select * from test where col1 = '''ant';
COL1
What you need to do is to double-up the apostrophes WITHIN the quoted string. The first apostrophe has the effect of escaping the second apostrophe.
Try this example:
COL1
SQL> SELECT * FROM test WHERE col1 = 'B''stard';
COL1
Hope this helps
Mark Griffiths. Received on Wed May 05 1999 - 06:53:52 CDT