开发者

Oracle Query with "&" special character

开发者 https://www.devze.com 2023-02-22 05:11 出处:网络
I have an Oracle query that is blowing up when I have an \"&D\" in the whe开发者_Go百科re statement

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

精彩评论

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