1.创建自增序列
CREATE SEQUENCE "SEQUENCE1"
INCREMENT BY 1
START WITH 1;
2.创建触发器
create or replace TRIGGER TRIGGER1
BEFORE INSERT ON TEST1
FOR EACH ROW
BEGIN
select SEQUENCE1.nextval into:New.ID from dual;
END;
其中TEST1为表名,ID为自增主键名
3.测试
insert into TEST1(NAME) VALUES('TESTNAME')