insert into INLIB_DETAIL
      (ID)
    Values
      (seq_Inlib_detail_id.nextval);
ID是自动增加的

解决方案 »

  1.   

    create table a(b int, c  varchar2(5));
    建一个序列
    create sequence a_seq increment by 1 start with 100;
    建一个触发器
    create or replace trigger t_a
    before insert on a
    for each row
    begin
         select s_a.nextval into :new.b from dual;
    end;
      

  2.   

    本人常用另一種方法:
    在trigger 定以一變量,trigger每次執行時從table中取出id最大的值,當insert資料時對變量加1!!!
      

  3.   

    --建序列
    create sequence seq_name 
    increment by 1
    start with 1
    maxvalue 99999999
    nocycle
    cache 10insert into table(....) values(seq_name.nextvalue,.....)或者
    select max(id)+1 into 变量 from table
    insert into table(....) values(变量,.....)
      

  4.   

    /*创建序列*/
    create sequence Cj_fs_YarningRecordSN
          INCREMENT BY 1
          START WITH 1
          MINVALUE 0
          MAXVALUE 999999999
          NOCYCLE
          NOORDER
          CACHE 20;/*创建触发器*/
    create or replace trigger insert_Cj_fs_YarningRecordSN
    before insert on Cj_fs_YarningRecord
    referencing old as old new as new 
    for each row 
    begin
        select Cj_fs_YarningRecordSN.nextval into :new.SerialNum from dual;
    end;