Oracle自动增长的序列号
首先建立序列:
Create sequence user_id Increment by 1 Start with 1 Maxvalue 1.0E28 Minvalue 1 nocycle Cache 20 Noorder;
然后建立触发器
create or replace trigger AUTO_ID_ADD before insert on userinfo referencing old as old_value new as new_value for each row begin select USER_ID.nextval into :new_value.id from dual; end;
这样就完成了ID自动增长。