好词好句
当前位置:首页 > 好词好句 > 列表页

oracle自增序列 [Oracle中生成自增序列-和存储过程]

泥巴往事网  发布于:2018-08-15  分类: 好词好句 手机版

oracle中没有自增列,这样的设定,必须手工写个方法 或用 序列 或用 触发器

还是用的序列方便(个人习惯)

1.create sequence salary_seq
2.
3.increment by 1 ---每次加几个
4.
5.start with 1 --从1开始计数
6.
7.nonmaxvalue --不设置最大值
8.
9.nocycle --一直累加,不循环
10.
11.cache 10 --有缓冲区
12.
13.
14.
15.eg create sequence salary_seq
16.
17.minvalue 100
18.
19.maxvalue 9999999999
20.
21.start with 560
22.
23.increment by 1
24.
25.cache 20;
26.
27.
28.
29.using : insert into tableName value(salary_seq.nextval,"","");

本文已影响

oracle自增序列 [Oracle中生成自增序列-和存储过程]