Re: Escape sequence in Oracle SQL

From: Mark D Powell <Mark.Powell_at_eds.com>
Date: 19 Jun 2003 18:46:26 -0700
Message-ID: <2687bb95.0306191746.57680e50_at_posting.google.com>


ningli2000_at_hotmail.com (Nick Li) wrote in message news:<bfc81ac6.0306191426.60f81616_at_posting.google.com>...
> Hi,
>
> I am trying to escape the "%" character in a query. For the following
>
> select name
> from mystest
> where name like 'INT %HOW%'
>
> The two rows returned are: INT %HOW%
> INT HOW.
>
> I would like to have the query to return the row "INT %HOW%" only.
>
> I tried to use "\" escape character in the "where" clause:
> where name like 'INT \%HOW\%'
>
> but still the same two rows are returned.
>
> I would appreciate any help.
>
> Thanks.
>
> Nick

Nick, I am not where I can test this but try   like '%\%HOW\%%' escape '\'

From the version 9 SQL manual section LIKE conditions: "To search for the characters % and _, precede them by the escape character" which must be a character string of length one.

HTH -- Mark D Powell --

HTH -- Mark D Powell -- Received on Fri Jun 20 2003 - 03:46:26 CEST

Original text of this message