oracle创建自增序列和触发器

创建自增序列
create sequence APP_SEQ
minvalue 1
maxvalue 999999
start with 1
increment by 1
nocache;
 
创建触发器
create or replace trigger APP_TRI
before insert on MMC_APP_BASE_INFO for each row
begin
select APP_SEQ.nextval into :new.appno from dual;
end;

猜你喜欢

转载自www.cnblogs.com/cutone/p/10897936.html
今日推荐