转自:http://bbs.csdn.net/topics/300191423
从第一引号向后,如果遇到第二个引号,则看这个引号后面时候有紧挨着的引号,如果有则第二个引号被转义,即该保留该引号后面紧跟的那个引号。用法举例:
declare
v_char varchar2(2) :='zz';
begin
execute immediate 'delete from aa where b='||''''||v_char||'''';
end;
或者
declare
v_char varchar2(2) :='zz';
begin
execute immediate 'delete from aa where b='''||v_char||'''';
end;