日期:2014-05-17 浏览次数:20893 次
create or replace trigger UserToTemp
after insert or update or delete on BETRAYLIST
for each row
declare
integrity_error exception;
errno integer;
errmsg char(200);
dummy integer;
found boolean;
begin
if inserting then
insert into FINISHREPORT
(fID, NameBetray)
values
(:NEW.fID, :NEW.NameBetray); --(fID=:NEW.fID,NameBetray=:NEW.NameBetray)有问题,语法不对
elsif updating then
update FINISHREPORT
set NameBetray = :NEW.NameBetray
where fID = :OLD.fID;
elsif deleting then
delete from FINISHREPORT where fID = :OLD.fID;
end if;
exception
when integrity_error then
raise_application_error(errno, errmsg);
end;