我正在尝试为 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;
/