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

Home -> Community -> Usenet -> c.d.o.tools -> Re: primary keys

Re: primary keys

From: Ian Sparkes <sparkes_at_sprintmail.com>
Date: 1997/06/09
Message-ID: <01bc7502$381dc230$11f0dfdf@sprintmail>#1/1

This is a really bad idea. It is called having intelligent keys, where you are identifying a row by a convenient grouping of columns rather than a set of columns that actually defines a row to be unique.

An example of where this could get you into trouble here could be using the formula below. What happens if the wrong date is entered on the order ? To fix it you would have to change the order date, functionally this would change the identity of a customer (not what was intended), practically you would have to update the primary key (not allowed) and then cascade the change across ALL associated tables.

Aldo Alejandro <aalejan_at_pacbell.net> wrote in article <01bc743a$da8362a0$cf05aace_at_aalejan.pacbell.net>...
> Hello everyone,
>
> How would you create primary keys in personal oracle 7.3 using the create
> sequence route?
> Also I would like my pk's to be informative (e.g.) customer order id # is
> today's date + order number
>
> The second case would be creating a pk that uses the concatenation of the
> first four letters of the fname and the first 4 letters of the lname.
> --
> Thanks & have a nice day! ;-)
>
Received on Mon Jun 09 1997 - 00:00:00 CDT

Original text of this message

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