Re: Relation problem

From: Michel <microworld_at_sympatico.ca>
Date: Mon, 29 Jan 2001 19:24:56 GMT
Message-ID: <csjd6.147902$JT5.5306452_at_news20.bellglobal.com>


How about using two addressLink tables?

PersonAddressLink and OrgAddressLink. Each of these can be related to the address table, and in turn an org is related to the orgaddresslink table. It would make implementation a bit more complex, since we now have two addresslink tables but easy enought. Now, we could have people and org sharing addresses, but that is Ok as long a people don't have the same address twice.

Michel

Jan Hidders <hidders_at_REMOVE.THIS.win.tue.nl> wrote in message news:94ver7$ond$1_at_news.tue.nl...
> wrote:
> > On 26 Jan 2001 23:25:21 GMT, hidders_at_REMOVE.THIS.win.tue.nl (Jan
> > Hidders) wrote:
> >
> > >By now I hope that you understand that I am missing the following
> > >constraint in your SQL:
> >
> > There's a good reason it's not there.
> >
> > >ALTER TABLE Parties
> > >ADD CONSTRAINT AbstractClass
> > >CHECK (
> > > EXISTS (
> > > SELECT * FROM Persons WHERE Persons.PersonID = Parties.PartyID
> > > )
> > > OR
> > > EXISTS (
> > > SELECT * FROM Organizations WHERE Organizations.OrgID =
 Parties.PartyID
> > > )
> > >)
> >
> > Add that constraint, and you can't add rows to any of the tables.

>

> You can if you have deferred constraint checking as defined in SQL'92
> (and in Oracle 8, I believe).
>

> > It's an interesting approach, but I don't think it will catch on in
> > practice.
>

> That is not what I wanted to suggest. All I wanted to say is that if
> you have something similar to an abstract class then this constraint
> should be considered. Usually it will be quite acceptable and perhaps
> even useful to ignore it and allow the class to be non-abstract, and in
> other cases you might ignore it because implementing it would lead to
> the update problems you suggested. But, as always, these design
> decisions should be taken deliberately and with care.
>

> PS. Can I ask you to set you full name in your newsreader? I believe
> you are using Forte Free Agent so that should be possible in
> 'Preferences' under the 'User' tab. Otherwise the attribution of
> what you wrote will sometimes look a bit awkward as is the case in
> this posting.
>

> --
> Jan Hidders

> Received on Mon Jan 29 2001 - 20:24:56 CET

Original text of this message