您的位置:首页 > 数据库 > Oracle

Oracle自增序列字段

2017-03-21 16:26 120 查看
个人学习

先创建sequence
create sequence human_bi_xq_seq increment by 1 start with 1 
minvalue 1 maxvalue 9999999999999 nocache 
order;

然后给表创建触发器
create or replace trigger human_bi_xq_trigger
before insert on human_bi_xq
for each row
begin
      select  human_bi_xq_seq.Nextval    into:new.PID from sys.dual ;
end;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: