我想为一个名为 payment 的表创建一个更新触发器,它将用另一个实体的价格值之间的差值get_out
和相乘的价格值更新成本列get_in
我在创建触发器方面没有太多经验,但到目前为止这就是我所拥有的
CREATE OR REPLACE TRIGGER o1 BEFORE UPDATE OF get_out ON payment
FOR EACH ROW
BEGIN
UPDATE payment
SET payment.cost = ROUND (24 * (to_date(payment.get_out)-to_date(payment.get_in)),0) *
(SELECT price FROM payment,book,place
WHERE book.ID_place = place.ID_place
AND payment.ID_payment = book.ID_payment
AND payment.ID_payment = :NEW.payment.ID_payment
)
;
END;
/
创建触发器时出现此错误:
使用编译错误创建的触发器。
LINE/COL ERROR
---------- -----------------------------------------------------------
7/43 PLS-00049: bad bind variable 'NEW.PAYMENT'
有什么建议吗?谢谢