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

Home -> Community -> Usenet -> c.d.o.tools -> Re: Automatic sequential record numbering?

Re: Automatic sequential record numbering?

From: Connor McDonald <connor_mcdonald_at_yahoo.com>
Date: 2000/08/13
Message-ID: <399680ED.21A5@yahoo.com>#1/1

Jon S wrote:
>
> Hi,
>
> I'm new to Oracle and I was wondering what the best method is for
> automatically generating a new sequential number for each record inserted in
> a table. For instance, I have a table that holds problem reports. Each
> report needs a unique identifier and should be sequential (i.e. the first
> one would be report #1, the second would be report #2, etc.) Also, I would
> like the numbers to not have any gaps in them so that I can keep track of
> each problem report. I'm currently using a sequence to accomplish this, but
> I was wondering if there was a better method.
>
> This application runs on WinNT 4.0 server as an IIS app with Oracle 8i.
>
> Thanks,
> Jon

A (well cached) sequence (say on a before-row trigger) would probably give the best performance.

Try veer away from the "must be contiguous" requirement - it causes problems.

HTH

-- 
===========================================
Connor McDonald
http://www.oracledba.co.uk

We are born naked, wet and hungry...then things get worse
Received on Sun Aug 13 2000 - 00:00:00 CDT

Original text of this message

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