Oracle非主键自增长
Oracle非主键自增长create sequence JCDA_GFYYXX_IDminvalue 1maxvalue 99999999start with 21increment by 1cache 20;create or replace trigger JCDA_GFYYXX_TB_ID_CFQbefore insert on JCDA_GFYYXX_TB --JCDA_GFYYXX_TB为表名for each rowdeclare-- local variables herenextid number; --自定义变量,用于存储从序列中取得的值beginIF :new.OBJECTID IS NULL or :new.OBJECTID=0 THENselect JCDA_GFYYXX_ID.NEXTVAL --从序列中取得下一个值,赋给变量nextidinto nextidfrom DUAL;:new.OBJECTID:=nextid;end if;end TRG_MAGGIE_TEST_TID;