Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

replacing single quotes with double quotes 2

Status
Not open for further replies.

lel75

Programmer
Nov 11, 2003
17
0
0
US
Hello,

I have problems querying through a web application system when a name has a single quote in it (e.g. O'Brien). Can you please show me how I can change this select so that the single quotes get replaced with double quotes? I've tried the REPLACE and the ESCAPE function but it does not work.

select_statement := select_statement || where_clause_append ||'last_name = ''' || UPPER(te_last_name) || '''';

Thanks in advance!

Cathy [sunshine]

 
Cathy,

My apologies for not understanding your "select_statement" clause, but you can certainly use some variation of this code:

...replace(UPPER(te_last_name),chr(39),chr(39)||chr(39))...

This tells Oracle that wherever it encounters a single quote [chr(39)] within te_last_name, replace it with two single quotes.

Dave
Sandy, Utah, USA @ 19:24 GMT, 12:24 Mountain Time
 
Dave,

That worked! Thanks again for all your help.

Cathy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top