问题描述
我正在使用Oracle Data Integrator开发一些ETL,有时还通过TOAD测试我的部分代码.今天我在TOAD上遇到了问题,我有一条类似
I am developing some ETL with Oracle Data Integrator and sometimes test parts of my code by TOAD. Today I had a problem with TOAD I had a line like
AND column_value like('DEV&PROD')
当我尝试运行上面包含过滤器的SQL时,TOAD询问PROD的值,它认为PROD是绑定或替换变量. TOAD设置中是否有任何选项可用于启用此功能.我将绑定变量与列(:)配合使用,并且我的数据包括&所以我需要使用它.
when I tried to run the SQL which includes filter above, TOAD ask for the value of PROD, it thought like PROD is a bind or substitution variable. Is there any option in TOAD settings to turn this feature of. I am using bind variable with a column (:), and my data includes & so I need to use it.
此代码可完美地在ODI中工作,我只需要TOAD的解决方案.预先感谢.
This code works in ODI perfectly, I only need a solution for TOAD. Thanks in advance.
推荐答案
1)使用set define off;
启动脚本(并使用F5键运行整个脚本)
或
2)使用'DEV&'||'PROD'
代替'DEV&PROD'
或
3)为变量设置另一个前缀符号
1) start your script with set define off;
(and run whole script with F5 key)
or
2) use 'DEV&'||'PROD'
instead of 'DEV&PROD'
or
3) set another prefix symbol for variables
set define ~;
select 'drag&drop', ~column_name from ~table_name;
(系统会提示您输入column_name和table_name,但不会提示您输入'drop')
(you will be prompted for column_name and table_name, but not for 'drop')
这篇关于TOAD认为& String是绑定变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!