create or replace TRIGGER PRODUCT_REORDER_AU
AFTER UPDATE ON PRODUCT
FOR EACH ROW
BEGIN
IF (PRODUCT.QUANTITY_IN_STOCK < PRODUCT.REORDER_POINT)
THEN
INSERT INTO PURCHASE_ORDER
(PO_NO, PO_DATE, PRODUCT_ID, QUANTITY, SUPPLIER_ID)
VALUES
(OLD.PO_NO, NEW.PO_DATE, OLD.PRODUCT.PRODUCT_ID, OLD.PRODUCT.REORDER_QUANTITY, OLD.PRODUCT.SUPPLIER_ID);
END IF;
END;
I'm trying to create a trigger to use on an update operation but am getting the following errors:
Error(8,1): PL/SQL: Statement ignored
Error(8,13): PLS-00357: Table,View Or Sequence reference 'PRODUCT.QUANTITY_IN_STOCK' not allowed in this context