当前位置:Gxlcms > 数据库问题 > oracle 自增列设置

oracle 自增列设置

时间:2021-07-01 10:21:17 帮助过:2人阅读

sequence sq_1 minvalue 1 maxvalue 9999999999999999999999999999 start with 1 increment by 1 cache 2000;

 

触发器

create or replace trigger 触发器名字
  before insert on 表名  
  for each row
declare
  -- local variables here
begin
   SELECT sq_1.nextval
  INTO :NEW.列名
  FROM DUAL;

end 触发器名字;

 

SQL语句

insert into gd(id) values(sq_1.nextval);

 

oracle 自增列设置

标签:

人气教程排行