Re: Unique rec. ID advice needed

From: Chris Fischer <cfischer_at_nando.net>
Date: 1996/04/16
Message-ID: <4kvva1$h07_at_castle.nando.net>#1/1


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.
 

>1. Should I use Number or Varchar2 or Char field?
>2. If I use a character ID, should I add leading zeros to fill the blanks?
>3. What is the best way to generate IDs in a multiuser environment?
>Should I keep a separate MaxCurrentID table and lock it every time I
>generate next ID?

+------------------------------------------------------------+
| Chris Fischer                           cfischer_at_nando.net |
| Sr. Systems Analyst                    Work: (919)676-0062 |
| Toys "R" Us                                                |
+------------------------------------------------------------+
Received on Tue Apr 16 1996 - 00:00:00 CEST

Original text of this message