Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: User Sequence Skipping Numbers???
klabranche (kevin_labranche_at_hotmail.com) wrote:
: I have gotten around this problem by using a select statement with
: finding the max value in the primary key field and adding one to it.
Gah, race condition! Pray that two people don't do the same thing at the same time, or else you must exclusively lock the table while selecting.
: I don't know if this is the best way to get around skipping values but
If you take a .NEXTVAL from the sequence then don't use it, then you have told the database to drop this value. However, sequences can also cache values (controlled by init.ora) which can cause jumps in sequences as well. We noticed this in Oracle Financials, with invoice numbers (I think!) having holes in them, and Oracle support determined this was due to sequence number caching. I believe the init.ora 'sequence_cache_entries' parameter controls this.
--
rgds
Stephen
Received on Mon Apr 05 1999 - 03:33:38 CDT
![]() |
![]() |