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 data consistency?

Re: How to ensure data consistency?

From: Felix E. Klee <felix.klee_at_inka.de>
Date: Fri, 10 Sep 2004 02:35:57 +0200
Message-ID: <20040910023557.5438db54.felix.klee@inka.de>


On Thu, 9 Sep 2004 01:46:28 +0200 Felix E. Klee wrote:
> To avoid orphaned rows in subtables, it seems necessary to set up
> circular foreign key constraints.

Just checked it, and it seems to work fine. To avoid an overload of new key values one could use the following model. Again checks that b is non null when spcialization_type="b", etc. need to be added. But this seems to be simple. The disadvantage of the model is of course that it contains at least one null value in each row in TS.

TS
t_id (PK)
specialization_type: Either "a", "b", or "c". b_t_id (UNIQUE) (FK->t_id) (FK->BS.t_id) c_t_id (UNIQUE) (FK->t_id) (FK->CS.t_id) [...]

BS
t_id (PK) (FK->TS.t_id)
[...]

CS
t_id (PK) (FK->TS.t_id)
[...]

Felix Received on Thu Sep 09 2004 - 19:35:57 CDT

Original text of this message

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