Link to home
Start Free TrialLog in
Avatar of kencheng123
kencheng123

asked on

Oracle escape character

Hi,

I am working with SQL plus on oracle database. When I try to insert a string that contains escape character like '&', it prompts for asking input for variable substitution as below:

Input query: "update table1 set column1 = 'AB&C'
Prompt: "Enter value for C:"

I try to add a slash before the '&' but it works the same.
Also, I try to blacket the '&' as '{&}' in the query and it gets success. But the field stores the '{}' at the same time. (e.g 'AB{&}C')

I would like to ask any good solutions to handle such escape characters when I input query in SQL plus ?

Thanks !

Ken
Avatar of UsamaMunir
UsamaMunir

In SQL* do this

SQL> Set scan off

SQL> update dept set dname = 'A&BC';
5 rows updated.


Setting the scan off tells sqlplus that dont scan for variables in the statements.

Regards
U
ASKER CERTIFIED SOLUTION
Avatar of dsthas
dsthas

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial