Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Delete child records
Message
 
 
À
03/04/2007 08:13:16
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Database:
Visual FoxPro
Divers
Thread ID:
01211605
Message ID:
01212325
Vues:
12
>Hello
>
>I have a hierarchical table, containing ID and ParentID fields. I have created a self-join on these two fields, then I have created a RI rule (using RI builder), that deletes the subordinate records when a parent record is deleted.
>
>I was surprised to find that this doesn't work. Instead I get a "Trigger failed" message. Now follows the question: Is there any way (beside recursive scanning) to delete all the subordinated records (and theirs subordinate records, and so on) when I delete a parent record?
>
>Thanks.

You can not update the same table in a trigger. You may execute some code from the place when you delete a record (not in a trigger) or you may try to use Table Rule, but then you would have to use InActive flag first...
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform