RE: Single Quote in Select Search

RE: Single Quote in Select Search

 

  

The function you are looking for is translate.
select translate('VIP''s', '''', '"') from dual;

Richard Quintin
VTLS, Inc.
http://www.vtls.com/
-----Original Message-----
From: sean feifer [mailto:[Email Address Removed] Wednesday, July 31, 2002 8:44 AM
To: LazyDBA.com Discussion
Subject: Re: Single Quote in Select Search



Thanks for all who responded. But my problem is how to make the sql
statement to convert ' to ''.
The Search Form is like : SEARCH __________. People would put in Keyword
like VIP or VIP's If it is VIP, I have no problem with SQL behind the form,
" select * from table where title='Keyword'.
If it is VIP's, it gives error cause it doesnt recognize " ' ". I need to
modify the sql statement to convert ' to ''. I am trying to use decode to
convert, but I have not found the right way yet. I hope there might be some
kind of function to do if ', then ''.
Thanks!

Oracle LazyDBA home page