plsql如何实现用触发器修改多个表中同一个字段的值?

2025-03-23 18:32:06
推荐回答(1个)
回答1:

伪代码:
create or replace t1_bu_trg on T1 for each row
declare
begin
if :new.ab <> :old.ab then
update t2 set ab = :new.ab
where ab = :old.ab;

update t3 set ab = :new.ab
where ab = :old.ab;
end if;
exception
when others then
raise_application_error(-20001,sqlerrm);
end;
/