ORACLE自增字段
设置如下:
sql>create table articletype(id number primary key,name varchar2(30));
sql>create sequence seq_aritcle_id increment by 1 start with 1 maxvalue 999999999;
sql>create trigger trg_articletype_id
before insert
on articletype
for each row
begin
select seq_articletype_id.nextval into :new.id
from dual;
end;
/
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/14999074/viewspace-562998/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/14999074/viewspace-562998/