Re: Relation problem
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
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