创建表,表名t_user,元素userid、username、userpwd
create table t_user(userid number(10) not null primary key,
username varchar2(40) not null,
userpwd number(10) not null);
创建序列化,USER_PRIMARY
create sequence USER_PRIMARY
minvalue 1
maxvalue 999999999999999999999999999
start with 21
increment by 1
cache 20
order;
创建触发器,user_autoinc_tg
create or replace trigger user_autoinc_tg
before insert on t_user for each row
begin
select user_primary.nextval into :new.userid from dual;
end user_autoinc_tg;