sql trigger error:invalid specification
i am creating a trigger and receiving some error, which i m not able to understand. Pls can anyone help me with that.
create or REPLACE TRIGGER trig_data
BEFORE INSERT
ON data_db REFERENCING OLD AS OLD AND NEW AS NEW
FOR EACH ROW
BEGIN
SELECT RAHUL_SEQUENCE.NEXTVAL INTO :NE开发者_Go百科W.USERID FROM DUAL;
END;
Error report:
ORA-04079: invalid trigger specification
04079. 00000 - "invalid trigger specification"
*Cause: The create TRIGGER statement is invalid.
*Action: Check the statement for correct syntax.
This part is wrong:
REFERENCING OLD AS OLD AND NEW AS NEW
There should be no "AND" there:
REFERENCING OLD AS OLD NEW AS NEW
(In fact why not just remove it altogether as it does nothing?)
精彩评论