Oracle建立视图触发器的代码:(注意里面的instead of)

create or replace trigger tg_E_CONTACT before instead of update or instead of insert or instead of delete on E_CONTACT for each row begin if inserting then insert into [email protected] values (:new.TELEPHONE, :new.EMPLOYEEID, :new.STATUS); else if updating then update [email protected] s set s.TELEPHONE = :new.TELEPHONE, s.EMPLOYEEID = :new.EMPLOYEEID, s.STATUS = :new.STATUS where s.employeeid = :old.employeeid; else if deleting then delete from [email protected] s where s.employeeid = :old.employeeid; end if; end if; end if; end;

你可能感兴趣的:(oracle)