在Oracle PL/SQL中,如何在字符串中轉義單引號?我試過這種方式,它不起作用。PL/SQL,如何在字符串中轉義單引號?
declare
stmt varchar2(2000);
begin
for i in 1021 .. 6020
loop
stmt := 'insert into MY_TBL (Col) values(\'ER0002\')';
dbms_output.put_line(stmt);
execute immediate stmt;
commit;
end loop;
exception
when others then
rollback;
dbms_output.put_line(sqlerrm);
end;
/
可能重複(http://stackoverflow.com/questions/6678478/escaping-single-quote-in-plsql) –