Home > Database > Mysql Tutorial > Oracle特殊符号的处理:set define off

Oracle特殊符号的处理:set define off

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 17:30:12
Original
2689 people have browsed it

Oracle特殊符号的处理,今天遇到一个问题,同事用动态sql生成的insert语句,其中含有符号,在做insert时,这个符号就被作为一

Oracle特殊符号&的处理,今天遇到一个问题,同事用动态sql生成的insert语句,其中含有&符号,,在做insert时,这个&符号就被作为一个变量提示符了。如何解决这个问题?其实很简单:set define off

SQL>create tablet (avarchar2(20));
 
Table created.
 
SQL> insertinto tvalues('aaa&bbb');
Enter valuefor bbb: .
old1:insert intot values('aaa&bbb')
new1:insert intot values('aaa.')
 
1 rowcreated.
 

SQL> rollback;
 
Rollback complete.
 
SQL>
SQL>--wenow setdefine toOFF,theninsert data.
SQL> setdefine off
SQL> insertinto tvalues('aaa&bbb');
 
1 rowcreated.
 
SQL> select *from t;
 
A
--------------------
aaa&bbb
 
SQL>

我们发现set define off后,带&符号的数据已经插入。

相关阅读:

Oracle 特殊符号'&'的处理

linux

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template