I have an existing sequence called TOPICSEQ in the database(oracle), there is a table called t_topic whose id is incremented using this TOPICSEQ. The detail of this seq is created like following
CREATE SEQUENCE TOPICSEQ
INCREMENT BY 1
START WITH 1001 MAXVALUE 9999 MINVALUE 1
NOCYCLE CACHE 20 NOORDER;
It works fine when populating the db with scripts, but when inserting the data using the format like this:
String insertTopic="INSERT INTO T_TOPIC VALUES (TOPICSEQ.NEXTVAL,?,0,'unchecked')";
the last topicID is 1006 in the table before I insert the data , after the insertion, the ID becomes 1021. I don't know what the hell it is and I thought it should follow the sequence since I specified the name of the sequence.
Please, just a week I have to submit my project. Any idea will be appreciated. Thanks a lot!