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
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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