Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Oracle Sequences

Re: Oracle Sequences

From: Rene Nyffenegger <rene.nyffenegger_at_gmx.ch>
Date: 16 Jan 2004 10:58:34 GMT
Message-ID: <bu8g4q$erh52$1@ID-82536.news.uni-berlin.de>

> 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.ch
Received on Fri Jan 16 2004 - 04:58:34 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US