Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
RI question
Message
De
25/11/2005 07:19:32
 
 
À
24/11/2005 19:38:01
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01071716
Message ID:
01072038
Vues:
32
>>Good tip, that. I've got the logging working nicely, just one more problem to overcome.
>>
>>In this particular case, I need to conditionally allow the cascade delete on the child records, depending on field data. If any fail, disallow the parent delete BUT keep the child deletions intact. Today, my mind is more on food that code. Tomorrow is another day....
>
>I am not sure whether I understood correctly. Under certain conditions, you want to delete the child records, but not the parent record?
>
>If that is the case, since it is somewhat different than regular RI, I suggest you write the code yourself. Perhaps if you set the RI-Delete action to "Ignore", you will avoid VFP messing around with your own function.
>
>The idea is to invoke your own function from the delete trigger. The function itself is stored in database stored procedures.
>
>It should be fairly easy to store the PK to a variable, open the child table, and delete all records that have the same value for the FK.
>
>Simply returning .F. from the trigger function (under certain conditions, if I understand correctly) will disallow the deletion of the parent record.

You understood just fine ;-) Thanks.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform