Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Delete Triggers
Message
De
11/07/1997 03:49:27
Nandakumar Heble
Polaris Software Labs Pvt Ltd
Chennai, Inde
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Groupes d'usagers
Titre:
Divers
Thread ID:
00039242
Message ID:
00039400
Vues:
31
>>Hi,
>>
>>How does one link tables in two different databases ? Lets say one DBC has 5 tables with one parent table having a Primary index. This has relationships with the other four tables and has a Cascading Delete trigger.
>>
>>There is one table in another DBC with its own primary index. THis table and the Parent table in the other DBC are essentially the same as VFP has no functionality to include the same table in more than one DBC. I would like to link the two tables so that when one record is deleted in the master table, the corresponding record in the other DBC is also deleted triggering off the Delete trigger.
>>
>>Basically I found one roundabout way to do this through code. Is there an easy way through the Database designer.
>>
>>Thanks
>>
>>Heble
>Heble,
>
>You must write the code specifically inteh delete trigger, there is no way to stroe persistent relationship information that crosses databases.
>
>However, I would suggest one design modification to you. Instead of having two copies of the same table int he two dbc's amke one master dbc that holds the shared tables and remove them from the other dbc's. This way there is only one copy of the data and there is one dbc which has lots of code in its triggers dealing with tables in other dbc's.

Jim,

Thanx for your help. There are actually around 350 tables with batches of them being used in different modules and so had to be divided into about 10 DBC's. There is only a set of about 5 tables which are common to them and are independent of the other 4 of them. That is the reason I had to use Junction tables in each of the other DBC's. Actually even when it is done through code, there is a problem. When VFP 5.0 generates the delete trigger RI from the persistent relationships, it sets a check for _triggerlevel for 1. If the junction table record is deleted from other trigger through code, it generates an error. So I need to open the VFP RI code in the DBC and include the phrase ".or. _triggerlevel=2" at all the relevant lines manually. This again gets modified if the RI code is generated manually. Is there an easy way to set this through the builder that the trigger can be run from another DBC through code instead of this laborious method ?.
When would the _triggerlevel actually be > 1 ?

Thanks,

Heble
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform