序列
create sequence sq_1 minvalue 1 maxvalue 9999999999999999999999999999 start with 1 increment by 1 cache 2000;
觸發器
create or replace trigger 觸發器名字 before insert on 表名 for each row declare -- local variables here begin SELECT sq_1.nextval INTO :NEW.列名 FROM DUAL; end 觸發器名字;
SQL語句
insert into gd(id) values(sq_1.nextval);