Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Question on how to mask characters in SQL ???
One solution, though it's not as elegant as I'd like is as follows:
select column
from table
where replace(column,'%','^') like 'searchvalue^%'
That is, replace percent symbols in the text with carets (or any other
character you choose) and then use the caret (or other character as
appropriate) in the search string.
hth
cc
Michael Maretzke 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.
Received on Wed Aug 12 1998 - 07:52:14 CDT
![]() |
![]() |