Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Delete child records, when parent record is deleted
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00523079
Message ID:
00523221
Vues:
10
>>>Nadya,
>>>
>>>Just set delete to cascade for the relation. Open the database, select Edit Referential Integrity from the Database menu, click on the Rules for Deleting tab, scroll to the Regions and TownRegions relation and set to cascade.
>>
>>Ok, now the question is: How can I get rid of the generated code? Suppose, I want to generate this code by myself (or using some special utility from Download section)? Seems like once added, I can get rid of it, and I can only delete it from SP code. Is it correct way?
>
>Hmmm... if you delete the generated code then you'll also be deleting the code that cascades the deletes to the child. If you're not happy with VFP's RI code engine, you might want to consider using a CASE tool for your database. I can recommend xCase (www.xcase.com), it allows you to define code templates for RI generation.

I used Walter's class from Download section and everything appears to work correctly, but I didn't understand the generated code. Anyway, I'll study it later...
If it's not broken, fix it until it is.


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

Click here to load this message in the networking platform