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: Foreign Keys

Re: Foreign Keys

From: Matty <mattycruft_at_daemons.net>
Date: Sun, 05 Jan 2003 21:33:31 -0500
Message-Id: <pan.2003.01.06.02.33.21.728443@daemons.net>


On Mon, 06 Jan 2003 00:01:04 +0100, Sybrand Bakker wrote:

> On Sun, 05 Jan 2003 16:40:56 -0500, "Matty" <mattycruft_at_daemons.net>
> wrote:
> 

>>Howdy folks,
>>
>>I am hoping someone can clarify something for me. If I
>>create a foreign key constraint on a table:
>>
>>ALTER TABLE bingo ADD constraint for_key_bingo
>>FOREIGN KEY (col1, col2)
>>REFERENCES yikes (col1,col2);
>>
>>and then add a new row to bingo, the col1/col2 attribute
>>values have to exist in yikes. I am curious what other
>>uses folks have for foreign keys?
>>
>>Thanks for any insight,
>>Ryan
>>
>>
>>
>>
>>
> This can't be a serious question.
> What else did you expect? The * purpose * of the foreign key is to
> avoid orphaned records and to enforce relational integrity.
> You need a foreign key if you have a *relationship* between 2
> entities. If you don't define foreign keys and don't enforce
> relational integrity, you will end up in a mess. Obviously, given your
> question, you don't care about that.
> 
> 


I phrased my question incorrectly, and was able to find a good explanation on Oracle Tech Net. Sorry to waste bandwidth.

Thanks for the reply,
Ryan Received on Sun Jan 05 2003 - 20:33:31 CST

Original text of this message

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