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> q'#Oracle's quote operator#' from dual;
Q'#ORACLE'SQUOTEOPERATO ----------------------- Oracle's quote operator
begin
execute immediate q'#select * from abc#';
end;
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10130206/viewspace-1049749/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/10130206/viewspace-1049749/