当前位置: 代码迷 >> 综合 >> oracle 触发器 pragma autonomous_transaction
  详细解决方案

oracle 触发器 pragma autonomous_transaction

热度:99   发布时间:2024-01-05 05:21:44.0
一般情况下在触发器中是不能使用DDL语句的,使用自治事务可以实现
可以在触发器中加入:pragma autonomous_transaction; 表示自由事务处理。
CREATE OR REPLACE TRIGGER temp_ais
AFTER insert  ON atest
for each row
DECLARE
pragma autonomous_transaction;
BEGINexecute immediate 'DROP TABLE AAA'; 
end;
  相关解决方案