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
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,
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.