Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: problem with a SQL select request
I believe the only way is to do a replace( ) on the string to double
up the quotes.
I'm curious what the performance implications of such tests & transformations are. E.g. sometimes I wind up doing replace(replace(replace(string,'this','that'),'whatever','wherever'),'something else','yet again'). Sometimes I check whether the replaced string really exists using instr( ),usually when doing only a single replacement. Sometimes I do the replace( ) in the main SELECT, other times I get the real values via subquery and do replace( ) in the outer query, yet others I wait and do the replace( ) in PL/SQL. I wonder if there is some best-performing way to handle a sequence of such transformations?
John
On 29 Aug 2001 14:13:45 GMT, manu <mp_at_coris.ch> wrote:
>
>Hi,
>
>I know it's a common problem, but I'd like to know if it exists a more simple
>solution ...
>
>in the following request :
>"SELECT LASTNAME FROM CONTACTS
>WHERE (((CONTACTS.LASTNAME) = ' " + name + " ') "
>
>if name = "N'Guyen" for exemple, an error is generated because of the orthograph
>of the word "name" .... it contains the character '
>
>Does it exist with Oracle a way to ignore or replace this character, or must I
>read every string and double the character to make Oracle accept to execute my
>SQL command ??
>
>I hope somebody will understand my question in spite of my ridiculous English
>
>Thank you in advance
>
>
>------
>User of http://www.foorum.com/. The best tools for usenet searching.
-- Got an Oracle database question? Try the search engine for the database docs at: http://tahiti.oracle.com/Received on Wed Aug 29 2001 - 13:33:19 CDT