Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: SQL 'ESCAPE' Problem
Your using the escape for the wrong purpose. the escape character can be defined so you can search for a string that has a % or _ in it (instead of like interpreting them as wildcards). For example
select * from emp where ename like 'K%\%' escape '\'
would search for anything that started with K and ended with %.
To get a quote in a character string, which seems to be what you want, you would:
select * from emp where ename like 'K%''%G'
the 2 quotes will be interpreted as one. This says find everythat that starts with K, has a ' in the middle and ends in G....
On Sat, 28 Jun 97 23:43:23 GMT, NoSpam_at_interaccess.com (Andre Allen) wrote:
>Hello Everyone
>
>I am having trouble with the following SQL Statement
>
>select loc_description
>where loc_description like 'Joe^'s%'
>escape '^'
>
>It seems that I can use the escape character on anything other than a single
>quote mark. The problem is, in mu customer table, I need to track and
>search for names like "Joe's computers" or "Bill's hot dogs". Am I doing
>something wrong?
>
>Any responses would be appreciated
>
>Andre Allen
>NoSpam_at_interaccess.com
>to reply, Please replace "NoSpam" with "andre"
Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Bethesda MD
http://govt.us.oracle.com/ -- downloadable utilities
![]() |
![]() |