0

我正在尝试为 Invoices 表创建一个名为 invoices_after_update_payment 的触发器,只要付款总额增加,它就会在输出窗口中显示供应商名称、发票编号和付款总额。

这是我第一次使用触发器,我得到的只是错误 在此处输入图像描述

create or replace trigger invoices_after_update_payment
after update
on invoices
for each row
when (new.payment_total > old.payment_total)
declare
vendor_name_var    vendors%rowtype%;
Begin
Select v.vendor_name, i.invoice_number, i.payment_total
into vendor_name_var, :new.invoice_number, :new.payment_total
from Vendors v
inner join Invoices i
on v.vendor_id = i.vendor_id
where i.vendor_id = :new.vendor_id
dbms_output.put_line(vendor_name_var || :new.invoice_number || :new.payment_total);
end;
/
4

1 回答 1

0

用分号结束这一行  where i.vendor_id = :new.vendor_id;  并编译以查看是否有任何错误。 

于 2012-11-18T19:52:09.497 回答