第一步:创建表
create table Test_Table
(
ID number(11) primary key,
Name varchar(50) not null,
Value1 varchar(50) not null
)
第二步:创建一个自增序列以此提供调用函数。
create sequence Seq_Test_Id
start with 1 //根据需要自己可修改该数值
increment by 1 //步长值
minvalue 1
nomaxvalue
到此可以实现自增,新增记录如下:
Insert into Test_Table(ID,Name,Value1)values(Seq_Test_Id.nextval,'xiyang','blog') ;