Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> comp.databases.theory -> Re: Relation problem

Re: Relation problem

From: <MSherrill_at_compuserve.com>
Date: Sat, 27 Jan 2001 01:04:52 GMT
Message-ID: <3a721e34.37187262@news.compuserve.com>

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 Systems
Received on Fri Jan 26 2001 - 19:04:52 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US