Reuse unused Sequence value
531441Apr 11 2008 — edited Apr 11 2008Good day all,
Can I have a way to reusing the unused values of a sequence.
let me make myself clear.
When I do an insert, for instance
insert into my_table (id, age) values (my_seq.nextval, 24);
and for a reason, the query fails. The currval of sequence was 2 but after the failed query, it becomes 3. So when I correct my query thus
insert into my_table (id, age) values (my_seq.nextval, 25);
what is inserted is (4, 25). At the end, I will have a id column that is not perfectly serial.
Now the question, how do I enforce my sequence structure to reuse the 3 (as in the last example)
Regards,
Michael