视频图像处理系列索引 || Arcgis/Engine/Server开发索引 || Web Map Gis开发索引 || jquery表格组件 JQGrid索引
WPF MVVM模式开发实现简明教程索引 || ArcGIS Runtime WPF(.net C#)开发简明教程索引

Oracle创建自增ID

 

先创建序列sequence

create sequence S_User

minvalue 1

nomaxvalue  -- 或 maxvalue 999

start with 1

increment by 1

cache 20; -- 或 nocache

 

参考:

oracle 序列中cache 有什么用途

 

然后创建触发器

create or replace trigger trg_user before insert on T_USER for each row

begin

select itsmp.S_User.nextval into :new.UserID from dual;

end;

posted @ 2016-11-16 17:56  jhlong  阅读(564)  评论(0编辑  收藏  举报
海龙的博客 jhlong@cnblogs 版权所有© 转载请注明链接.有用请推荐一下
代码全部经过本人测试,但不保证复制粘贴就正常运行,更不保证能解决你的问题,请结合前后代码及描述理解后修改和使用