Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Network:
Windows 2000 Server
>>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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement