日期:2014-05-16 浏览次数:20404 次
create sequence template_seq start with 1 increment by 1 nocycle cache 99999
create trigger template_trig before insert on template for each row--template是表名 declare nextid number; begin if: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;