Re: Relation problem
Date: 27 Jan 2001 21:33:27 GMT
Message-ID: <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.
-- Jan HiddersReceived on Sat Jan 27 2001 - 22:33:27 CET