Re: Auto_Increment
Quote
Assume you have a table with an auto_increment primary key.
OK.
Quote
Assume you have 100 records in the table such that the highest primary key value is 100.
I would
not assume that.
Values can be "skipped" because they are allocated by rows being added but the transactions creating those inserts are rolled back before completion. The Id values are not "released" or "reused".
Quote
Then assume that for whatever reason you delete that last record. When the next record is later added, will the primary key value of 100 be skipped or will it be repeated since the old record with 100 was deleted?
The value will not be reused. The next record would [probably] by 101.
Auto-Increment values are guaranteed to be
unique but not to be
sequential, nor should that matter to you in the slightest.
Regards, Phill W.
Subject
Written By
Posted
Re: Auto_Increment
April 04, 2018 05:12AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.