Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2003
    Posts
    8

    Unanswered: Sequence problem..

    Hi,All
    I am puzzled by a problem about sequence,Now,
    I create a global temperatory table
    MD_RL_BOM_ORG1(ID number,name varchar2(20),werks varchar2(20))
    And a SEQUENCE ,
    CREATE SEQUENCE IDB_BOM_NUM_SEQ
    START WITH 1
    INCREMENT BY 1
    MINVALUE 1
    NOMAXVALUE
    NOCYCLE
    CACHE 100
    NOORDER
    Then,when insert data into table MD_RL_BOM_ORG1,the ID column is from SEQUENCE IDB_BOM_NUM_SEQ,and the other two columns are from another table(The code of insert data is done in a procedure)
    while I execute "Truncate table MD_RL_BOM_ORG1",and by then execute the folloing SQL statement:select IDB_BOM_NUM_SEQ.nextval from dual,I found that the sequence start from 1 again,but I do nothing to it,is there any relation between the "Truncate table " and the SEQUENCE?

    Any pearls of wisdom will be mostly welcome,
    Rgs,xujb

  2. #2
    Join Date
    Aug 2002
    Location
    SHANGHAI,CHINA
    Posts
    20
    It is imposible there is any relation between the "Truncate table " and the SEQUENCE.
    SEQUENCE and Table are independence database object.When u insert row into table,u must write.
    INSERT INTO MD_RL_BOM_ORG1 VALUES(IDB_BOM_NUM_SEQ.nextval,...).

    When execute IDB_BOM_NUM_SEQ.nextval,the sequence will increment by itself.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •