我正在尝试编写查询,但收到错误:
SQL*Plus: Release 11.2.0.1.0 Production on Thu May 24 11:24:48 2018
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
SQL> select 'I'm Looking for study guides 1Z0-071, 1Z0-146, 1Z0-148!' from dual;
错误: ORA-01756:引用的字符串未正确终止
答案 0 :(得分:0)
您可以使用quoting string literal
:
select q'{I'm Looking for study guides 1Z0-071, 1Z0-146, 1Z0-148!}'
from dual;
<强> DBFiddle Demo 强>
这种机制非常有用,特别是在生成大量动态SQL时,可以避免所有笨拙的'''''
。