开发者

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';
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜