& 符号在 SQLPLUS 的转义

有时候,SQL语句中包含了 & 符号,&是数据库中存储的值,而非要求我们输入某个值, 如果你在 SQLPLUS中运行该SQL,

可以用 set define off 命令 忽略 &

举个例子:

SQL> select 'hello &word' from dual;
Enter value for word:
old 1: select 'hello &word' from dual
new 1: select 'hello ' from dual

'HELLO
------
hello

SQL>
SQL>
SQL> set define off
SQL>
SQL> select 'hello &word' from dual;

'HELLO&WORD
-----------
hello &word

原文地址:https://www.cnblogs.com/ss-33/p/10072574.html