我有 Oracle 10gR2。我正在尝试创建自动增量触发器。这是示例:
CREATE SEQUENCE TEST_SEQ
INCREMENT BY 1
START WITH 1
NOMAXVALUE
/
CREATE TABLE TESTER (
ID_TESTER INTEGER NOT NULL,
VAL VARCHAR2(20) NOT NULL
)
/
CREATE OR REPLACE TRIGGER TIB_TESTER BEFORE INSERT
ON TESTER FOR EACH ROW
BEGIN
SELECT TEST_SEQ.NEXTVAL
INTO :NEW.ID_TESTER
FROM DUAL;
END;
/
触发器创建给出警告:
警告:ORA-24344:编译错误成功
当我得到错误值时:
select OCI_SUCCESS_WITH_INFO;
/
它给出了错误:
错误:ORA-00923:在预期的地方找不到 FROM 关键字