一、设置序号
# demo_seq为序列名称 CREATE SEQUENCE TB_BNMB_SEQ minvalue 1 maxvalue 9999999999999999999 increment by 1 start with 1;
二、设置触发器自增
CREATE OR REPLACE TRIGGER Trigger_TB_BNMB BEFORE INSERT ON TB_BNMB for each row when(NEW.ID is NULL) begin select TB_BNMB_SEQ.Nextval into :NEW.ID from dual; end;