create table AppInfo ( fid number primary key,fappID VARCHAR2(32) not null,fappSecret VARCHAR2(32) not null );
2.创建自增序列
CREATE SEQUENCE voucherdb_sequence INCREMENT BY 1 -- 每次加几个 START WITH 1 -- 从1开始计数 NOMAXVALUE -- 不设置最大值 NOCYCLE -- 一直累加,不循环 NOCACHE -- 不建缓冲区
3,设置触发器
create trigger AppInfo_trig before insert on AppInfo for each row when (new.fid is null) begin select voucherdb_sequence.nextval into:new.fid from dual; end;原文链接:https://www.f2er.com/oracle/212797.html