oracle的自增需要依靠序列和触发器共同实现
比如
先创建一个表
create table test(id int primary key,
name varchar2(10));
创建一个序列
create sequence test_seq
increment by 1
start with 1
minvalue 1
maxvalue 9999999999999
nocache
order;
触发器实现
create or replace trigger test_trigger
before insert on testfor each row
begin
select test_seq.Nextval into:new.id from dual;
end;
然后你试试吧
insert into test (name) values ('张三');