Home » SQL & PL/SQL » SQL & PL/SQL » & symbol in data
& symbol in data [message #195946] Tue, 03 October 2006 04:56 Go to next message
ar_shriks
Messages: 2
Registered: September 2006
Junior Member
I run the following query:

select *
from atable
where col_value = 'SHG&CSGCS000332'


I get the following prompt :
Enter value for csgcs000332:

The & is actually part of the column value here. How do I read this record?

Regards
Shriks
Re: & symbol in data [message #195948 is a reply to message #195946] Tue, 03 October 2006 05:00 Go to previous messageGo to next message
Cthulhu
Messages: 381
Registered: September 2006
Location: UK
Senior Member
You will need to issue the command:

set scan off

This means SQL*Plus will no longer scan for substitution variables. If you still want to use substitution variables, you can use a different character e.g. to change it to "*", use

set define *
Re: & symbol in data [message #195955 is a reply to message #195948] Tue, 03 October 2006 05:29 Go to previous messageGo to next message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
Closed. Next time, search for ampersand.

http://www.orafaq.com/forum/fa/448/0/

MHE
Re: & symbol in data [message #196013 is a reply to message #195948] Tue, 03 October 2006 12:50 Go to previous message
William Robertson
Messages: 1640
Registered: August 2003
Location: London, UK
Senior Member
I bet someone at Oracle is wondering why they bothered to deprecate SET SCAN OFF back in Oracle 7.3 if they were going to keep supporting it for the next 10 years. I'm amazed that it still works.
Previous Topic: ORA-13249
Next Topic: Why do I need a Declare for this?
Goto Forum:
  


Current Time: Sun Mar 26 06:12:13 CDT 2017

Total time taken to generate the page: 0.04370 seconds