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中无效的触发器规范:
我该如何解决?