通过触发器和自增序列实现oracle自增ID

database

create sequence seq_tablename
       start with 1
       increment by 1; 
create or replace trigger tri_tablename_insert
        before insert on tablename
        referencing old as old new as new
        for each row
      begin
        select seq_tablename.nextval
          into :new.ID
          from dual;
      end tri_tablename_insert;

以上是 通过触发器和自增序列实现oracle自增ID 的全部内容, 来源链接: utcz.com/z/531547.html

回到顶部