Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
RI question
Message
From
25/11/2005 07:19:32
 
 
To
24/11/2005 19:38:01
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01071716
Message ID:
01072038
Views:
31
>>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.
Previous
Reply
Map
View

Click here to load this message in the networking platform