oracle int自增长
1. 先建表(此处略去)
2. 创建Sequence
create sequence template_seq start with 1 increment by 1 nocycle cache 99999
3.创建触发器
create trigger template_trig beforeinsert on template for each row--template是表名declarenextid number;beginif:new.templateid is null or :new.templateid=0 then--templateid是template表的列select template_seq.nextval into nextid from sys.dual;:new.templateid:=nextid;end if;end;