sql触发器错误:规范无效

时间:2010-06-30 13:03:33

标签: sql sql-server oracle11g plsqldeveloper

我正在创建一个触发器并收到一些我无法理解的错误。请允许任何人帮助我。

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 :NEW.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.

1 个答案:

答案 0 :(得分:0)

这部分错了:

REFERENCING OLD AS OLD AND NEW AS NEW

那里应该没有“AND”:

REFERENCING OLD AS OLD NEW AS NEW

(事实上,为什么不完全删除它,因为它什么都不做?)