你的位置:首页 > 数据库

[数据库]oracle 自增长序列

create or replace TRIGGER "METTINGUSER".TRG_PREPN
BEFORE INSERT ON "PREPROJFUN"
FOR EACH ROW
BEGIN
SELECT SEQ_PRN.NEXTVAL INTO :NEW.PRN_ID FROM DUAL;
END;

CREATE SEQUENCE SEQ_PRN_1

INCREMENT BY 1 START WITH 1 NOMAXVALUE NOCYCLE NOCACHE