如何避免在 Oracle SQL Developer 中使用 'trinidad & 进行变量替

2023-09-20数据库问题
0

本文介绍了如何避免在 Oracle SQL Developer 中使用 'trinidad & 进行变量替换多巴哥'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

当我尝试在 Oracle SQL Developer 2.1 中执行此语句时,会弹出一个对话框输入替换变量",要求为 TOBAGO 提供替换值,

update t set country = 'Trinidad and Tobago' where country = 'trinidad &多巴哥';

如果不求助于 chr(38)u'trinidad 026 tobago' 两者都掩盖了语句的目的,我该如何避免这种情况?

解决方案

在查询前调用:

set 定义关闭;

或者,hacky:

update t set country = 'Trinidad and Tobago' where country = 'trinidad &'||'多巴哥';

<小时>

来自调整 SQL*Plus:><块引用>

SET DEFINE OFF 禁用解析命令以替换替换变量及其值.

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';

How can I avoid this without resorting to chr(38) or u'trinidad 026 tobago' which both obscure the purpose of the statement?

解决方案

Call this before the query:

set define off;

Alternatively, hacky:

update t set country = 'Trinidad and Tobago' where country = 'trinidad &' || ' tobago';


From Tuning SQL*Plus:

SET DEFINE OFF disables the parsing of commands to replace substitution variables with their values.

这篇关于如何避免在 Oracle SQL Developer 中使用 'trinidad &amp; 进行变量替换多巴哥'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

SQL 子句“GROUP BY 1"是什么意思?意思是?
What does SQL clause quot;GROUP BY 1quot; mean?(SQL 子句“GROUP BY 1是什么意思?意思是?)...
2024-04-16 数据库问题
62

为什么 Mysql 的 Group By 和 Oracle 的 Group by 行为不同
Why Mysql#39;s Group By and Oracle#39;s Group by behaviours are different(为什么 Mysql 的 Group By 和 Oracle 的 Group by 行为不同)...
2024-04-16 数据库问题
13

如何在MySQL中为每个组选择第一行?
How to select the first row for each group in MySQL?(如何在MySQL中为每个组选择第一行?)...
2024-04-16 数据库问题
13

MySQL - 获取最低值
MySQL - Fetching lowest value(MySQL - 获取最低值)...
2024-04-16 数据库问题
8

mySQL init 脚本未与 docker-compose 一起运行
mySQL init scripts not running with docker-compose(mySQL init 脚本未与 docker-compose 一起运行)...
2024-04-16 数据库问题
14

在 cmakelist.txt 中添加和链接 mysql 库
Add and link mysql libraries in a cmakelist.txt(在 cmakelist.txt 中添加和链接 mysql 库)...
2024-04-16 数据库问题
41