[Tip]如何在SQL*PLUS中插入含有'&'的字符串?

[Tip]如何在SQL*PLUS中插入含有'&'的字符串?

方法一
在SQL*PLUS中用这个命令:
set define off

方法二(推荐)
参见如下的例子:

SQL> truncate table demo;

Table truncated.

SQL> select * from demo;

no rows selected

SQL> desc demo;

Name Null? Type
----------------------------------------- -------- -----------------
X CHAR(20)

SQL> insert into demo values ('scott&'||'tiger');

1 row created.

SQL> select * from demo;

X
--------------------
scott&tiger

Published At
Categories with 数据库类
comments powered by Disqus