Oracle Query with "&" special character
I have an Oracle query that is blowing up when I have an "&D" in the whe开发者_Go百科re statement
select <field> from <table> where field = 'ABC&D';
The Oracle Variable window pops up asking for a value for :D.
Any ideas?
Turn off variable substitution via:
set define off
Then run your query. SQL*Plus is interpreting the &D as a runtime substitution variable.
Another option, if you do not wish to use SET
commands, is to use concatenation:
select <field> from <table> where field = 'ABC' || '&' || 'D';
精彩评论