| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: How to ensure data consistency?
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
![]() |
![]() |