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 characters in PL/SQL

Status
Not open for further replies.

megabyte214

Programmer
Nov 7, 2001
40
US
I am trying to use the replace function to replace a single quote " ' " with a backwards single quote " ` ".

Code:
tempT := replace(SRCSTR => tempT,OLDSUB => ''',NEWSUB => '`');

This code produces a compile error:
Error: PLS-00103: Encountered the symbol "`" when expecting one of the following:

. ( ) , * @ % & = - + < / > at in is mod not rem
<an exponent (**)> <> or != or ~= >= <= <> and or like between ||

Any suggestions as to what I am doing wrong?
 
Megabyte,

Within a matching pair of single quotes, you must code two successive single quotes to produce one single quote. So, if the rest of your code is correct, then the following should produce the result you want:
Code:
tempT := replace(SRCSTR => tempT,OLDSUB => '''',NEWSUB => '`');

Let us know your findings,

[santa]Mufasa
(aka Dave of Sandy, Utah, USA @ 16:07 (24Sep04) UTC (aka "GMT" and "Zulu"), 09:07 (24Sep04) Mountain Time)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top