17,086
社区成员
发帖
与我相关
我的任务
分享
create or replace trigger is tri_name
after update on tableName
for each row--这个一般都要加上,因为我们一般都是行级触发器,即对每一行都操作
declare --在变量申明的地方,指定自定义事务处理。
pragma autonomous_transaction;
begin
if :new.a<>:old.a or :new.b<>:old.b then
update tableName t set t.c=1 where t.a=:old.a and t.b=:old.b;
commit;
end if;
end;
create or replace trigger is tri_name
after update on tableName
for each row--这个一般都要加上,因为我们一般都是行级触发器,即对每一行都操作
declare --若没有变量,则可以省略declare
begin
if :new.a<>:old.a or :new.b<>:old.b then
update tableName t set t.c=1 where t.a=:old.a and t.b=:old.b;
end if;
end;