1 --创建表
2 create table test
3 (
4 id number primary key,
5 name varchar2 not null
6 );
7 --创建序列
8 create sequence test_seq
9 start with 1 increment by 1;
10
11 --创建触发器
12 create or replace trigger tri_test_zz
13 before insert on test
14 for each row
15 begin
16 select test_seq.nextval into :new.id from dual;
17 end;