你的位置:首页 > oracle自增字段

oracle自增字段

更新时间: 2019/4/23 13:06:29     点击率: 570
create sequence SEQ_repeatprintinfo
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

--触发器
CREATE OR REPLACE TRIGGER TRIG_repeatprintinfo
    before insert ON SSWL_USER.repeatprintinfo     for each row
declare
m_seq number;
begin
select SEQ_repeatprintinfo.nextval into m_seq from dual;
:new.id:=m_seq;
end;