create sequence seq_字段名_表名
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 10;



CREATE OR REPLACE TRIGGER tri_字段名_表名
BEFORE insert ON 表名
FOR EACH ROW
begin
    select seq_字段名_表名.Nextval into:New.自增字段名 from dual;
end;

  

相关文章: