Re: Unique rec. ID advice needed

From: Johnny Chan <jchan_at_mod6>
Date: 1996/04/18
Message-ID: <4l6ctu$19v_at_male.EBay.Sun.COM>#1/1


Stan Varlamov (slv_at_superlink.net) 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?
 

: Any practical advice appreciated.

A sequence generator of numbers is your best bet. If you are worried about performance and index storage implications, consider reversing the generated number so your unique numbers are interspersed well.

jc Received on Thu Apr 18 1996 - 00:00:00 CEST

Original text of this message