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:
00523188
Views:
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.

Thanks a lot, Brien. I'm afraid, though, that it's overkill for me right now (I may consider it in a future). Right now I'm trying to create a simple code, which would delete all child records. Following Larry suggestion, that it's not the best code, I decided to write it using some other tool. Currently I'm looking at Walter's RIBuilder from Download section.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform