ORA-04079:无效的触发器规范

时间:2016-04-12 08:40:52

标签: oracle triggers oracle-apex

create or replace trigger fineCalc
AFTER UPDATE ON book_issue
for each row
when ((new.date_of_return-old.date_of_issue)>7) 
declare 
  rcpt_no  number;
  s_id  char(10);
begin
  if :old.card_id in (select card_id from STUDENT_BOOK_ISSUE)
  then
    select max(receipt_no) into rcpt_no from fine;
    select student_id into s_id from STUDENT_BOOK_ISSUE sbi where sbi.card_id=:old.card_id;

    insert into fine values( rcpt_no+1,((:NEW.date_of_return-:OLD.date_of_issue-7)*5),s_id);
  end if;
end;

这得到了ORA-04079:Apex的SQL Workshop中无效的触发器规范:

Oracle Apex screenshot

我该如何解决?

0 个答案:

没有答案