Re: I can not understand relationship.Please help me.

From: Mark Woytus <mwoytus_at_divcomp.com>
Date: Wed, 27 May 1998 04:10:33 GMT
Message-ID: <356b8e71.4207497_at_news.dave-world.net>


On Wed, 27 May 1998 11:03:31 +0900, <ute68247_at_geocities.co.jp> wrote:

>I want to cancel relation key.
>But I don't know what will happen to Oracle database.
>If I cancel relation key(forrign key),what do key make effect?
>
>Please help me.
>
>PS If you can't my english,sorry.Because I am Japanese.hahaha!
> And If you want to become my friend,Please send e-mail to me.
> I am Japanese and I live in japan.Therefore I can not make foreign
>friend.
> bye bye
>
The foreign key constraint is used to create a "parent-child" relationship between two tables. The foreign key column in the child table refers to a corresponding column in the parent table. When the foreign key constraint is enabled, in order to insert a row in the child table, the foreign key value must match some value in the corresponding columns in the parent table. This is probably why you want to disable your foreign key constraint -- it's not letting you insert a row into the child table.

If you disable the foreign key constraint, you will see no immediate effect on your database. You might not ever see an effect. What you will get is "orphan" rows. Whoever designed your constraints intended to preserve a connection between the rows in the child table and those in the parent. In other words, you're supposed to access the child rows by first accessing the parent rows. If you insert child rows without parents, you might not be able to access them through your application.

I'd be very careful turning off that constraint. I would first make sure I had a really good understanding of the database design. It may be that the assumptions used to create the constraint are no longer valid, and turning off the constraint is highly appropriate. Find out first.
Mark Woytus (w)309.888.8423 (f)309.888.8246 Diversified Computer Consultants
mwoytus_at_divcomp.com woytus_at_acm.org Received on Wed May 27 1998 - 06:10:33 CEST

Original text of this message