普通用户普通身份
create user yao identified by "654321"
grant connect,resource to yao
conn yao/654321
create table TP
(
ProID NUMBER primary key,
ProName VARCHAR2(20)
);
创建序列
create sequence SE
minvalue 1
maxvalue 9999999
start with 1
increment by 1
NOCYCLE
NOCACHE;
创建触发器
create or replace trigger tp_se
before insert on TP
for each row
begin
select se.nextval into:new.ProID from dual;
end;
插入数据
insert into TP values (1,'aa')
insert into TP (ProName) values ('bb')