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

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,"","");