是否可以在一个 EXECUTE IMMEDIATE 块中执行一些 sql 命令?
这种语法有什么问题:
declare
pragma autonomous_transaction;
begin
execute immediate
'begin
COMMENT ON TABLE t1 IS ''description1'';
COMMENT ON TABLE t2 IS ''description2'';
end;';
end;
对于一个 SQL 命令,它工作正常:
declare
pragma autonomous_transaction;
begin
execute immediate ' COMMENT ON TABLE t1 IS ''description1'' ';
end;