开发者

sql trigger error:invalid specification

开发者 https://www.devze.com 2023-01-05 10:02 出处:网络
i am creating a trigger and receiving some error, which i m not able to understand. Pls can anyone help me with that.

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?)

0

精彩评论

暂无评论...
验证码 换一张
取 消