自增序列: create sequence RS minvalue 10 最小值 nomaxvalue 无最大值 start with 20 开始值 increment by 1 每次加1 nocycle 不循环 nocache; 不进缓存
触发器: CREATE OR REPLACE TRIGGER Rst BEFORE INSERT ON V_EVENT_CFG FOR EACH ROW WHEN (new.ID is null) begin select RS.nextval into:new.id from dual; end;原文链接:https://www.f2er.com/oracle/213731.html