如何避免在Oracle SQL Developer中变量替换“特立尼达和多巴哥”
-
22-09-2019 - |
题
当我尝试的Oracle SQL Developer 2.1对话框来执行该语句的 “输入替换变量”的弹出,询问针对的多巴哥的
update t set country = 'Trinidad and Tobago' where country = 'trinidad & tobago';
我怎样才能避免这种不诉诸chr(38)
或u'trinidad \0026 tobago'
这两者混淆语句的目的是什么?
解决方案
查询之前调用此:
set define off;
可替换地,哈克:
update t set country = 'Trinidad and Tobago' where country = 'trinidad &' || ' tobago';
SET DEFINE OFF禁用命令的解析,以取代 替换变量与它们的值。
其他提示
在SQL *加上把SET DEFINE ?
在脚本的顶部通常会解决这个问题。可能为Oracle SQL开发工作,以及
此将作为你问而不CHAR(38):
update t set country = 'Trinidad and Tobago' where country = 'trinidad & '|| 'tobago';
create table table99(col1 varchar(40));
insert into table99 values('Trinidad &' || ' Tobago');
insert into table99 values('Trinidad &' || ' Tobago');
insert into table99 values('Trinidad &' || ' Tobago');
insert into table99 values('Trinidad &' || ' Tobago');
SELECT * FROM table99;
update table99 set col1 = 'Trinidad and Tobago' where col1 = 'Trinidad &'||' Tobago';
设置扫描断; 上述命令也有效。
我是有一些解决这个问题了。东西被启动试图设置每次我到任何DB的连接..
什么工作对我来说是去除任何启动脚本,你可能已经配置!
即。 Tools>Preferences...>Database
和
删除任何文件路径,你有标记的文本框中
“文件名,用于连接启动脚本”!
不隶属于 StackOverflow