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

Home -> Community -> Usenet -> c.d.o.server -> Re: Mixed Alphanumeric Unique IDs???

Re: Mixed Alphanumeric Unique IDs???

From: Mark D Powell <Mark.Powell_at_eds.com>
Date: 1 May 2003 07:38:25 -0700
Message-ID: <2687bb95.0305010638.2e25081b@posting.google.com>


Connor McDonald <connor_mcdonald_at_yahoo.com> wrote in message news:<3EB09625.3BF1_at_yahoo.com>...
> DTS wrote:
> >
> > Hi group,
> > I'm wondering what the best way is to construct unique ID's for
> > primary keys and such. I would like to create unique keys that use a
> > combination of letters and numbers. Oracle sequences only generate
> > numbers - should I consider some form of hashing algorithm, such as
> > MD5? In general, what are the best practices for primary key usage in
> > Oracle???
> >
> > THANKS!
> > DTS
>
> A quick and easy way is to convert the number to hex, then you will
> "pseudo-alphanumeric"
>
> hth
> connor

Connor, interesting trick. Another method would be to concatenate the sequence value to a leading alpha character so as to allow easy visual identification by type from each other for customer numbers, vendor numbers, work order numbers, and sales order numbers for example. This can be done in before triggers very nicely.

Received on Thu May 01 2003 - 09:38:25 CDT

Original text of this message

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