更新后Oracle触发器返回

时间:2012-11-18 19:47:21

标签: oracle join plsql triggers

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

这是我第一次使用触发器,而我得到的只是错误 enter image description here

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;
/

1 个答案:

答案 0 :(得分:0)

使用半冒号终止此行,如 where i.vendor_id = :new.vendor_id;  并编译以查看您是否收到任何错误。