start with 1401 sequence从1401开始增长
下面的触发器就是每插入一条记录ID字段取sequence.nextvalue以实现自增长,oracle中用这个来实现sql server中自增字段的功能。

解决方案 »

  1.   

    :new.ID 指新增加的记录的ID字段的值
      

  2.   

    序列(SEQUENCES)
    this table are in the data dictionary:ALL_SEQUENCES 
    ALL_SEQUENCES describes all sequences accessible to the user. Related views:
    DBA_SEQUENCES describes all sequences in the database. USER_SEQUENCES describes all sequences owned by the current user. This view does not display the SEQUENCE_OWNER column. Column  Datatype  NULL  Description  
    SEQUENCE_OWNER 
    VARCHAR2(30) 
    NOT NULL 
    Name of the owner of the sequence SEQUENCE_NAME 
    VARCHAR2(30) 
    NOT NULL 
    Sequence name MIN_VALUE 
    NUMBER 
    Minimum value of the sequence MAX_VALUE 
    NUMBER 
    Maximum value of the sequence INCREMENT_BY 
    NUMBER 
    NOT NULL 
    Value by which sequence is incremented CYCLE_FLAG 
    VARCHAR2(1) 
    Does sequence wrap around on reaching limit ORDER_FLAG 
    VARCHAR2(1) 
    Are sequence numbers generated in order CACHE_SIZE 
    NUMBER 
    NOT NULL 
    Number of sequence numbers to cache LAST_NUMBER 
    NUMBER 
    NOT NULL 
    Last sequence number written to disk. If a sequence uses caching, the number written to disk is the last number placed in the sequence cache. This number is likely to be greater than the last sequence number that was usedSample:
    Create sequence myseq increment by 1 start with 10 nomaxvalue nocycle cache10;
      

  3.   

    satar with 就是开始值
    increment by 1 是增长为1
    cache 20 为每次增长为20对于以上触发器,每次插入数据触发触发器,插入到id
      

  4.   

    increment by 1 我知道是每次增长1
    但是cache 20 为每次增长20就让我有点莫不着头脑