Oracle自增序列字段
2017-03-21 16:26
120 查看
个人学习
先创建sequence
create sequence human_bi_xq_seq increment by 1 start with 1
minvalue 1 maxvalue 9999999999999 nocache
order;
然后给表创建触发器
create or replace trigger human_bi_xq_trigger
before insert on human_bi_xq
for each row
begin
select human_bi_xq_seq.Nextval into:new.PID from sys.dual ;
end;
先创建sequence
create sequence human_bi_xq_seq increment by 1 start with 1
minvalue 1 maxvalue 9999999999999 nocache
order;
然后给表创建触发器
create or replace trigger human_bi_xq_trigger
before insert on human_bi_xq
for each row
begin
select human_bi_xq_seq.Nextval into:new.PID from sys.dual ;
end;
相关文章推荐
- [转 逆水行船]Oracle中创建表,创建序列,创建自增字段,添加注释, 添加记录,添加触发器,提交
- Oracle 创建自增字段的方法—使用序列方法(2)
- Oracle中创建自增字段(序列sequence)方法
- oracle 通过序列实现某字段自增
- oracle设置自增字段,oracle序列
- oracle 字段自动编号——触发器实现,非调用序列方法
- 创建序列和触发器实现Oracle字段自增功能
- ORACLE序列(字段自增长)
- oracle增删改字段、建表、建序列
- ORACLE 批量插入 主键为自增序列 有几个字段数据从其他表导入的 有几个是固定的
- Oracle 使用序列创建自增字段
- Oracle中创建表,创建序列,创建自增字段,添加注释, 添加记录,添加触发器,提交
- 使用Oracle 序列 和 触发器实现 字段自增长的方法
- oracle中使用序列和触发器实现单个字段值自增长
- Oracle 创建自增字段的方法—使用序列方法(1)
- oracle序列实现自增字段
- Oracle使用序列创建自增字段(主键自动增长)
- oracle利用序列和触发器使字段自增
- Oracle 使用序列创建自增字段
- Oracle中insert into select from用法、table (fn_split())用法、select中的as扩展替代字段用法、Oracle序列