假设我们有以下触发器:
create or replace trigger TR_TEST
for update or insert or delete
on TABLE_X
compound trigger
type array is table of TABLE_X%rowtype index by binary_number;
recs array;
before each row is
i number default rowids.count + 1;
begin
recs(i).a := nvl(:NEW.a, :OLD.a);
recs(i).b := nvl(:NEW.b, :OLD.b);
recs(i).c := nvl(:NEW.c, :OLD.c);
recs(i).d := nvl(:NEW.d, :OLD.d);
end before each row;
after statement is
begin
-- Do procedure here that will throw an exception
end after statement;
end TR_TEST;
当 after 语句抛出异常并且未处理时,数组的内容会发生什么?它会被自动清理还是会在整个会话期间保留在内存中?如果后者是真的,那么处理它以防止内存泄漏的正确方法是什么?谢谢!