Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Delete child records, when parent record is deleted
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00523079
Message ID:
00523246
Views:
9
>>>>>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...
>
>I'm glad it's working for you. I have to admit, I'm surprised anyone's gone to the trouble of rewriting the RI code... I've always been happy with VFP's generated code. I'll have to take a look at Walter's class - what advantages did you find it has over the VFP code?

I'm not sure, I found them. I didn't understand VFP auto-generated code and I din't understand Walter's code either (haven't studied neither of them seriously). However, Readme claims, that it's better and faster than VFP auto-generated code, so I just rely on that. May be Walter can say something about it.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform