- create sequence SEQ_TEST
- minvalue 1
- maxvalue 999999999999999999999999999
- start with 126661
- increment by 1
- cache 20;
这个就是oracle实现自增的触发器了,TB_ID是表中得主键:
- create or replace trigger TRI_TEST
- before insert on tb_ticket_log
- for each row
- declare
- begin
- select SEQ_TEST.Nextval into:new.TB_ID from dual;
- end TRI_TEST;