Paradox Community

Items in pnews.paradox-development

Subject:Re: Referential Integrity
Date:Fri, 30 Nov 2018 14:07:24 -0800
From:Peter <peter@whiteknight.email>
Newsgroups:pnews.paradox-development
I need to make my example a little clearer.

I am not talking about ri between the owner/vehicle/invoice tables. I am 
concerned with (child) tables of any of these three tables.

For instance, an appointment table with ri to the vehicle table would 
have the ownerid automatically updated.
(simplified structure to stay on topic)
Vehicle -->>Apts.db
Vid          AptID
Oid          Vid
              Oid

If the vehicle was transferred to another owner card the the Oid would 
be automatically updated in AptID.db

The need to transfer a vehicle to another owner can happen when a 
vehicle is sold or if the user created a new vehicle card under the 
wrong owner.

Peter



On 11/30/2018 01:22 PM, Peter wrote:
> I learned sometime back that the problem with using ri is that when a 
> child table is locked, Pdox places a lock on all the parent tables 
> upstream.
> 
> The advantage of it is that when the parent table is updated then the 
> child table's foreign keys are also updated at teh same time. This has a 
> huge benefit in the following dm
> 
> Owner -->> Vehicle -->> Invoice Hist
> Oid        Vid           Iid
>             Oid (fk)      Vid (fk)
>                           Oid (fk)
> 
> In the above example if a vehicle is sold to another customer then the 
> O(wner)id is changed in the Vehicle table but if connected using ri then 
> it (Oid) is also updated automatically in the invoice history table.
> 
> I have hundreds of tables that have foreign keys of the above tables. If 
> I do not use ri then the only thing I can see is maintaining a list of 
> all child tables and run a syncronizing routine on each in the correct 
> sequence.
> 
> Is there any other way of approaching this besides using ri?
> 
> Thanks for any thoughts.
> 
> Peter


Copyright © 2004 thedbcommunity.com