ORACLE自增

11/6/2009来源:Oracle教程人气:2868

--索引

CREATE SEQUENCE TABLE INCREMENT BY 1 START WITH 1 NOCYCLE CACHE 20 NOORDER;.

--触发器
CREATE OR REPLACE TRIGGER T_TABLENAME
    BEFORE INSERT ON TABLENAME FOR EACH ROW
BEGIN
    SELECT S_TABLENAME .NEXTVAL INTO :NEW.ID FROM DUAL;
END;