CREATE TRIGGER update_orderline
AFTER INSERT OR UPDATE ON ORDERS
FOR EACH ROW
BEGIN
INSERT INTO ORDERLINE(orderline_no, qty, order_no, product_no)
VALUES (ol_no.nextval, :new.qty, :new.order_no, :new.product_no);
END;
我試圖創建一個觸發器,在新記錄插入訂單後更新orderline表。但我得到這個錯誤:觸發器更新另一個表
Error(3,26): PLS-00049: bad bind variable 'NEW.QTY'
Error(3,51): PLS-00049: bad bind variable 'NEW.PRODUCT_NO'
你能給我們ORDERS表的結構嗎?和ORDERLINE? – Xavinou 2011-03-04 18:05:40
@ Xavinou:order_no,employee_no,branch_no,order_date,ship_date,shipping_method,tax_status,小計,tax_amt,shipping_charge,total_amt,customer_no – tbrown 2011-03-04 18:10:36
您能解釋業務邏輯嗎?數量從哪裏來?使用封裝了訂單的插入/更新的存儲過程或order_line – 2011-03-05 04:12:35