Re: Unique rec. ID advice needed

From: Austin Moseley <\"moseba_at_audv55.aud.alcatel.com'>
Date: 1996/04/26
Message-ID: <4lp3se$b1o_at_news01.aud.alcatel.com>#1/1


cfischer_at_nando.net (Chris Fischer) wrote:
>I would use a numeric key combined with a sequence generator. See the
>SQL Language Reference manual under CREATE SEQUENCE.
>
>slv_at_superlink.net (Stan Varlamov) wrote:
>
>>What is the best way to build unique record IDs such as Product ID to use
>>for reference from Sales table? The ID should be assigned automatically
>>by the program every time a new Product is added to the Product table.
>

Do not expect the numbers generated by the sequence to be without gaps. If your server goes down, or someone selects on the sequence, or ??, then the sequence will burp forward one or more digits from the point of view of the table. If you do not know this, it can be fun looking for "those missing rows." Sequences are fine if the gaps will not bother you.

-Austin Received on Fri Apr 26 1996 - 00:00:00 CEST

Original text of this message