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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Create a foreign key from a field that is part of a mulitple primary key

Re: Create a foreign key from a field that is part of a mulitple primary key

From: Niall Litchfield <niall.litchfield_at_dial.pipex.com>
Date: Sun, 5 Sep 2004 20:19:14 +0100
Message-ID: <413b6693$0$20243$cc9e4d1f@news-text.dial.pipex.com>


"Mark C. Stock" <mcstockX_at_Xenquery .com> wrote in message news:SbSdnR0ccbBME6rcRVn-sQ_at_comcast.com...
> so, if you're offended, sorry. but if you're up for a lively discussion,
why
> not post a structure that you feel requires more than one column for the
> PK -- either we'll see each other's side better, or you'll have the
> satisfaction of proving me wrong ;-)

A possibility for you. We have an helpdesk app. It contains, not entirely surprisingly, an inventory table. That table contains the fields MODEL and SERIAL#, we use (MODEL,SERIAL#) as the PK. I'm not prepared to guarantee uniqueness of the serial# across manufacturers and over time. I am prepared to gurantee the uniqueness of SERIAL# across the same model from the same manufacturer over time. I'll grant you that we could use an artificial key (and in fact it would be my preference), never the less for the design of the app the important thing is that it is an item of inventory (not that it is a laptop made by manufacturer y or a router made by company Z).

-- 
Niall Litchfield
Oracle DBA
http://www.niall.litchfield.dial.pipex.com
Received on Sun Sep 05 2004 - 14:19:14 CDT

Original text of this message

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