ITPub博客

首页 > 数据库 > Oracle > ORACLE之q操作符

ORACLE之q操作符

原创 Oracle 作者:qqmengxue 时间:2011-05-12 14:23:31 0 删除 编辑

ENV:

ORACLE RELEASE

OBJECT:Q operator

[@more@]

oracle本身默认的是单引号,但是在大家写存储过程或者写SQL语句时,有时候需要拼SQL或者是SQL的值里需要传入含单引号的值,此时就需要使用两个单引号"''"来进行转义,其实oracle本身提供了这种转换默认单引号为其他标识的方法那就是——"q"

q [Oracle's quote operator]

q'c text-to-be-quoted c'
c is a single character (called the quote delimiter). 
With the «quote operator» apostrophes don't have to
 be doubled: 
SQL> select q'#Oracle's quote operator#' from dual;
Q'#ORACLE'SQUOTEOPERATO
-----------------------
Oracle's quote operator
begin
execute immediate q'#select * from abc#';
end;

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/10130206/viewspace-1049749/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2009-03-26

  • 博文量
    169
  • 访问量
    589150