Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Trigger
Message
 
 
To
10/04/2002 15:49:01
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00643372
Message ID:
00643437
Views:
8
>Go to VFP (or TaxRI) referential integrity, create the self-relation, and select "cascade" for the delete part. That's all! VFP (or TaxRI) will create all the required code.
>
>HTH, Hilmar.

I don't think, trigger could be recursive. Oh, well, now I have to check it in Help :)

>
>>Hi guys!
>>
>>I have this situation: I have self-related table and want to delete a record X and all the records below it.
>>Example:
>>
>>these are the records in my table:
>>
>>Employee - Boss
>>******** ********
>>Bill .Null.
>>Joe Bill
>>Mark Joe
>>John Mark
>>Peter Joe
>>Paul John
>>
>>So, I have this logical structure:
>>
>>Bill
>> |__Joe
>>     |__Mark
>>     |   |__John
>>     |       |__Paul
>>     |__Peter
>>
>>I want that, when I delete Joe, Mark, John, Paul and Peter get deleted too!
>>
>>I thought about 2 ways of doing that: the first one is a recursive function, where I would first "walk" and after delete (the deletion order would be paul, John, Mark, Peter and Paul). The other way (which i don't know if may work) is to create a trigger for the delete event on the table, but with this one I am not getting the idea.
>>
>>Please, which one is better? Can you explain and give an example?
>>
>>TIA,
>>
>>Alonso
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