Home >Database >Mysql Tutorial >Oracle SQL 插入特殊字符

Oracle SQL 插入特殊字符

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-07 16:46:431315browse

对于插入数据库数据的语句:INSERT INTO TESTTAB(FIELD1) VALUES(

对于插入数据库数据的语句:
INSERT INTO TESTTAB(FIELD1) VALUES('测试')
如果插入数据库的字符串中还有单引号,需要转义处理,如插入“It's a tree.”,SQL语句如下:
INSERT INTO TESTTAB(FIELD1) VALUES('It''s a dog.')
如果SQL中有“&”,那么后面的字符串将被作为一个变量来处理,,无法正常插入数据库。
如果的确需要把&字符插入数据库,如下处理:
INSERT INTO TESTTAB(FIELD1) VALUES('I work in R'||'&'||'D.')

更多Oracle相关信息见Oracle 专题页面 ?tid=12

linux

Statement:
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