首页 > 代码库 > oracle触发器自增字段

oracle触发器自增字段

1.创建序列代码-- Create sequence  create sequence seq_userinfo  minvalue 1  start with 1  increment by 1;   
2.创建触发器代码create or replace trigger tigger_userinfo  before insert on userinfo  for each row  declare  begin  select SEQ_userinfo.nextval into:New.id from dual;  end tigger_userinfo; 

 原文地址:http://database.51cto.com/art/201004/196729.htm

oracle触发器自增字段