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: How to ensure only one of two sets of optional information?

Re: How to ensure only one of two sets of optional information?

From: abombss <abombss_at_comcast.net>
Date: 22 Dec 2003 12:07:30 -0800
Message-ID: <c3839e52.0312221207.70a0c89d@posting.google.com>


"Marshall Spight" <mspight_at_dnai.com> wrote in message news:<AwIEb.88899$8y1.292404_at_attbi_s52>...
> I could do it with a database constraint. Is there a structural
> way to do it that I'm not seeing? If I have to use a constraint,
> is there a canonical form for this particular example? It seems
> like a common thing to want to do, but I haven't come across
> how to address the subtype-data-exclusion issue anywhere.
>

Here is an article that describes how to create a multi-table primary key. While this is not built directly into the RDBMS it can be achieved through stored procedures and triggers. Using Celko's mutual inclusion pattern and these multi-table constraints you can ensure that every row in the account table will have a referencing row in one of the sub account tables.

http://www.devarticles.com/c/a/SQL_Server/Primary_Key_on_Multiple_Tables_RDBMS_Concept_SQL_SERVER_2000/

Adam Received on Mon Dec 22 2003 - 14:07:30 CST

Original text of this message

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