当我试图在Oracle SQL Developer 2.1中执行此语句时,弹出一个对话框"Enter Substitution“,要求为多巴哥值进行替换。
update t set country = 'Trinidad and Tobago' where country = 'trinidad & tobago';
我如何避免这一点,而不求助于chr(38)
或u'trinidad \0026 tobago'
,这两者都模糊了语句的目的?
发布于 2010-02-25 12:49:01
在SQL中,将SET DEFINE ?
放在脚本的顶部通常可以解决这个问题。可能也适用于Oracle SQL Developer。
发布于 2018-10-08 05:51:50
在没有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';
发布于 2021-08-05 21:43:15
如果您使用liquibase运行sql文件,它将不会给出错误。但对于sql开发人员,请在使用sql sode之前使用此set define off;
。
https://stackoverflow.com/questions/2333994
复制相似问题