Home » SQL & PL/SQL » SQL & PL/SQL » How to replace '&' with '& ' ?
How to replace '&' with '& ' ? [message #29747] Fri, 19 March 2004 10:08 Go to next message
Bala
Messages: 205
Registered: November 1999
Senior Member
Hi,

 

I want to search the '&' character and replace with '&'.

Is it possible in SQL or pl/sql?

thanks

bala

 
Re: How to replace '&' with '& ' ? [message #29749 is a reply to message #29747] Fri, 19 March 2004 14:12 Go to previous messageGo to next message
William Robertson
Messages: 1643
Registered: August 2003
Location: London, UK
Senior Member
'&' only has a special meaning within SQL*Plus, where it is the default DEFINE character. Use SET DEFINE to choose a different character, or switch it off altogether. '&' has no special meaning in PL/SQL.
SQL> set def off

SQL> SELECT REPLACE('Some text containing &','&','&') FROM dual;

REPLACE('SOMETEXTCONTAININ
--------------------------
Some text containing &

1 row selected.
Re: How to replace '&' with '& ' ? [message #29750 is a reply to message #29749] Fri, 19 March 2004 14:16 Go to previous message
William Robertson
Messages: 1643
Registered: August 2003
Location: London, UK
Senior Member
Oops, the page interpreted my "amper-amp;" symbol as "&" (and Preview lied) anyway you get the idea...
Previous Topic: add time to date
Next Topic: incrementing field from 1 through Z, byte by byte.
Goto Forum:
  


Current Time: Wed Jul 23 12:35:46 CDT 2025