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: Building a primary key

Re: Building a primary key

From: Chrysalis <cellis_at_iol.ie>
Date: 1997/03/27
Message-ID: <333ADC1B.C8@iol.ie>#1/1

The first job is to ensure that your table represents a normalised relation. If it does then, by definition, there should be some combination of columns (the primary key) whose values are unique across all the rows of the table. In this case there is no necessity for an additional (alternate) key to be defined, although such an aditional key may be useful in certain circumstances (e.g. as an alternative reference for foreign keys if the original primary key is considered too long).

If you *must* have a sequential monotonic key, then the sequence number represents your best bet: I agree that using a date is fraught with difficulties.

Hope this helps.

Chrysalis.

aramssb_svil wrote:
>
> Hi there!!!
>
> I have a question that seem to be simple...
>
> I have to identify each row in my table with a unique key.
>
> In which way can i build this key without using a sequence???
>
> I heard a rumour about using a date, but i can't find the way to
> manipulate the date format of Oracle to obtain not seconds but fractions
> of this.
>
> If someone have some suggest, please e-mail me or post an answer.
>
> Thanks in advance
>
> ---
> Danilo Riccitelli & Andrea Pallotta
> Development Team - Digital Italy
Received on Thu Mar 27 1997 - 00:00:00 CST

Original text of this message

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