主要是建序列和触发器:一张表建一个触发器和序列;例如
触发器:create or replace trigger SYS_CODE_INS_TRG before insert on "SYS_CODE" for each row begin if inserting then if :NEW."ID" is null then select SYS_CODE_ID_SEQ.nextval into :NEW."ID" from dual; end if; end if; end;
序列:
如图所示,这样就完成了自增id的设置
阅读(1873) | 评论(0) | 转发(0) |