Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Oracle Sequences
> All,
> I am using Oracle sequences to generate the values for my ID Columns in most
> of the tables in my schema. The ID column itself is a Primary Key. IS this a
> good Idea?
>
> Due to the nature of our work skipping sequences is not a good practice.
> Sometimes however when a rollback is issued the generated sequences number
> is lost.
> Is there a way to prevent this . For example if I were to insert the ID
> using a trigger before insert, and a rollback occurred will I lose the
> number?
> Is there a better way to prevent skipping sequences?
Jawahar,
Oracle's sequences are not meant to be id generators that don't skip numbers. They're meant to be highly scalable id generators. The 'price' for this scalability is that ids might be skipped.
hth
Rene
-- Rene Nyffenegger http://www.adp-gmbh.chReceived on Fri Jan 16 2004 - 04:58:34 CST
![]() |
![]() |