Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Question on how to mask characters in SQL ???

Re: Question on how to mask characters in SQL ???

From: <nasof_at_hotmail.com>
Date: Wed, 12 Aug 1998 13:41:41 GMT
Message-ID: <6qs62l$lps$1@nnrp1.dejanews.com>


Use: select * from table_name where column_name like 'Test\%Test%' ESCAPE '\';

The first % is escaped and treated as a literal and the second is a wildcard search (it is not escaped.) The trick here is the use of the ESCAPE keyword at the end of the statement.

-Frank

In article <35D1578A.99E40715_at_ibs.debis.de>,   Michael Maretzke <michael_at_ibs.debis.de> wrote:
> Hello there !
>
> I'm using a Oracle RDBMS and have a little problem. I know that some
> Characters are reserved characters in SQL. Inserting them into a
> CHAR-attribute in a table is no problem because they're masked
> by the single quoting marks ('). After inserting them ... how to
> select them from the table ?
> Using "SELECT * FROM table WHERE zzz = 'Test%Test';" works realy fine.
> But
> how can I select these lines using the LIKE condition ?
>
> "SELECT * FROM table WHERE zzz like '%%%';" doesn't work. I wanted
> to select all rows containing a % in attribute ZZZ ...
>
> Any suggestions ?
>
> Any tips on where to get these informations in Oracle docu ;)) ???
>
> CU Michael.
>

-----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum Received on Wed Aug 12 1998 - 08:41:41 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US