当前位置: 代码迷 >> Oracle管理 >> 请指点错哪了,多谢
  详细解决方案

请指点错哪了,多谢

热度:91   发布时间:2016-04-24 05:24:54.0
请指点哪里错了,谢谢
新手,刚弄了一个,有点疑惑,谢谢了
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(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;



请看一下哪里出错了

------解决方案--------------------
SQL code
create or replace trigger UserToTemp  after insert or update or delete on BETRAYLIST  for each rowdeclare  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;
  相关解决方案