| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Relation problem
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. It's an interesting approach, but I don't think it will catch on in practice.
-- Mike Sherrill Information Management SystemsReceived on Fri Jan 26 2001 - 19:04:52 CST
![]() |
![]() |