日期:2014-05-16 浏览次数:20407 次
?
创建序列:
create sequence ccxx_ver_seq start with 1 increment by 1;
?
创建触发器:
create or replace trigger ccxx_ver_trig
before insert on ccxx
for each row begin?
select ccxx_ver_seq.nextval into :new.version from dual;
end;
?
ccxx为触发器应用的表名
version为需要进行值自增长的字段名称
?
测试:
insert into ccxx(ID,XM,SFZH,XS_SZMD_ID) values('aa','aa','aa','aa');
commit;