AMS_1989
AMS_1989

Reputation: 13

oracle sql developer missing on keyword

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

Upvotes: 1

Views: 134

Answers (1)

Gordon Linoff
Gordon Linoff

Reputation: 1269463

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.

Upvotes: 2

Related Questions