1

I keep getting the "missing on keyword" message on the following query and I'm not sure why:

CREATE OR REPLACE TRIGGER TRG_LINE_PRODUCT AFTER INSERT UPDATE OR DELETE ON 
TBL_CH08_LINE FOR EACH ROW
BEGIN
IF INSERTING THEN UPDATE TBL_CH08_PRODUCT P SET P_QOH = P_QOH-:NEW.LINE.UNITS
WHERE P.P_CODE = :NEW.P.P_CODE;
END IF;
END;
/

1 Answer 1

2

You are missing an OR, in fact:

CREATE OR REPLACE TRIGGER TRG_LINE_PRODUCT
    AFTER INSERT OR UPDATE OR DELETE ON TBL_CH08_LINE
-----------------^
    FOR EACH ROW

Oracle is expecting ON after the INSERT, which is why you get that particular error.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.