如何在Oracle SQL Developer中避免使用'trinidad&多巴哥' [英] How to avoid variable substitution in Oracle SQL Developer with 'trinidad & tobago'
本文介绍了如何在Oracle SQL Developer中避免使用'trinidad&多巴哥'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我尝试在Oracle SQL Developer 2.1中执行此语句时,会弹出一个对话框输入替换变量" ,要求输入 TOBAGO 的替换值,
When I try to execute this statement in Oracle SQL Developer 2.1 a dialog box "Enter Substitution Variable" pops up asking for a replacement value for TOBAGO,
update t set country = 'Trinidad and Tobago' where country = 'trinidad & tobago';
如何避免这种情况而不求助于chr(38)
或u'trinidad \0026 tobago'
两者都使语句的目的模糊不清?
How can I avoid this without resorting to chr(38)
or u'trinidad \0026 tobago'
which both obscure the purpose of the statement?
推荐答案
在查询前调用此方法:
set define off;
或者,hacky:
update t set country = 'Trinidad and Tobago' where country = 'trinidad &' || ' tobago';
从调整SQL * Plus :>
From Tuning SQL*Plus:
SET DEFINE OFF禁用要替换的命令的解析 替换变量及其值.
SET DEFINE OFF disables the parsing of commands to replace substitution variables with their values.
这篇关于如何在Oracle SQL Developer中避免使用'trinidad&多巴哥'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文