Home » SQL & PL/SQL » SQL & PL/SQL » "&" in insert statements
"&" in insert statements [message #204251] Sun, 19 November 2006 19:27 Go to next message
monikagupta
Messages: 8
Registered: June 2006
Junior Member
Hi All,
I want to run a script(.sql) which has various insert statements.
example: INSERT INTO TMP_SERVICE_ATTRIBUTES_LIST ( SEAL_NAME, SEAL_DESCRIPTION ) VALUES (
'PORT_&_SLOT', 'Port & Slot Information.');

Now,since my data contains '&' , when this script is executed on sqlplus,it considers it as reference variable , and asks for its value.So,my question is,how can i tell sqlplus,to not to read '&' as reference variable,and read it as a normal data.Somebody please help.


Thanks & Regards
Monika
Re: "&" in insert statements [message #204252 is a reply to message #204251] Sun, 19 November 2006 20:05 Go to previous messageGo to next message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
Check here escape special characters.
Re: "&" in insert statements [message #204255 is a reply to message #204252] Sun, 19 November 2006 21:07 Go to previous messageGo to next message
monikagupta
Messages: 8
Registered: June 2006
Junior Member
Thanks a lot! It really worked.

Regards
Monika
Re: "&" in insert statements [message #204266 is a reply to message #204251] Sun, 19 November 2006 22:38 Go to previous messageGo to next message
knowmebetter
Messages: 1
Registered: November 2006
Junior Member

Hello...monika
Well there can be another solution...before the insert starts just type "set scan off" in the sql script and "set scan on" at the end of the script.
Please tell me it worked or not.
regds
Re: "&" in insert statements [message #204292 is a reply to message #204266] Mon, 20 November 2006 00:16 Go to previous messageGo to next message
rleishman
Messages: 3724
Registered: October 2005
Location: Melbourne, Australia
Senior Member
Is there an echo in here?

SET SCAN OFF was included in @ebrian's link.
Re: "&" in insert statements [message #204293 is a reply to message #204266] Mon, 20 November 2006 00:18 Go to previous message
monikagupta
Messages: 8
Registered: June 2006
Junior Member
Yeh! I used "Set scan off" in the starting of my script and it worked.Thanks.


Regards
Monika
Previous Topic: how to insert data into a column
Next Topic: Rowid
Goto Forum:
  


Current Time: Sun Dec 04 10:59:30 CST 2016

Total time taken to generate the page: 0.09444 seconds