CREATE TRIGGER B_trg
AFTER DELETE OR UPDATE OF B_BMBM ON TAB_B
FOR EACH ROW
declare
...
begin
...
if updating then 
...
elsif deleting then 
...
end if;
...
end;

解决方案 »

  1.   

    CREATE TRIGGER B_trg
    after DELETE OR UPDATE OF B_BMBM ON TAB_B
    FOR EACH ROW
    declare
    ...
    begin
    ...
    if updating then 
    ...
     update tab_a set 字段=:new.字段 where 字段=:old.字段;
     
    elsif deleting then 
    ...
    update tab_a set 字段='' where 字段=:old.字段;
     
    end if;
    ...
    end;
      

  2.   

    create or replace trigger test 
        after update or delete on tableb
        for each row
    begin
        if updatint then 
            update testa a set a.部门编码=:new.部门编码 where a.部门编码=:old.部门编码;
        else
            update testa a set a.部门编码='' where a.部门编码=:old.部门编码;
        end if;
    end;