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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PL/SQL - How to handle &

Status
Not open for further replies.

wellster34

Programmer
Joined
Sep 4, 2001
Messages
113
Location
CA
Hi,

In PL/SQL, the & is used to a variable holder. So, if you tried to make a variable like:

test_tx := 'Test one & two';

it asks for the value of two when trying to execute the code.


Is there a way to make PL/SQL accept the text as is? So, basically ignoring the & so that the text keeps its original value?


Thanks for your time.
 
I found a solution:

SET ESCAPE ON
SET ESCAPE "\"
test_tx := 'Test one \& two';


It works!!! yeah.
 
Wellster,

Another method (which I prefer) is
Code:
set define off
...then you do not need to "escape" your data. [smile]

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[ Providing low-cost remote Database Admin services]
Click here to join Utah Oracle Users Group on Tek-Tips if you use Oracle in Utah USA.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top