ORACLE的序列用来辅助生成自增列用得。
CREATE OR REPLACE TRIGGER SET_APPLOG_ID
BEFORE INSERT ON APPLOG FOR EACH ROW
DECLARE
NEXT_APPLOG_ID NUMBER;
BEGIN
SELECT ID_APPLOG.NEXTVAL
INTO NEXT_APPLOG_ID
FROM DUAL
;
:NEW.APPLOGID:=NEXT_APPLOG_ID;
END;
CREATE SEQUENCE AUTEK.ID_APPLOG
START WITH 1
MAXVALUE 999999999999999999999999999
MINVALUE 1
NOCYCLE
NOCACHE
NOORDER;