Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why 'Zap' works with 'Delete' set to 'Restrict' in RI?

Status
Not open for further replies.

rnathan

Programmer
Jun 27, 2002
41
US
Hi

I have a DB container (VFP 6.0) in which I have set up the Delete trigger to 'Restricted' for two tables in the Referential Integrity Builder. These two tables have parent-child relationship. What I noticed was I was able to zap the parent table (shocking...) but when I tried to delete a record from the child table I got the Trigger Failed error as I expected. My question is why Zap didn't give me a 'Trigger Failed' error?

Rita
 
Hi Rita,

By very creation of this command, the manual specificaly says, that the trigger will not be activated. ZAP is used only when a table need to be cleared. No RI triggers will be called.

However, if you need to do RI checks, then you should use.. DELETE ALL command instead of ZAP command.
Then do a PACK. Remember to open the table exclusively.

:)

____________________________________________
Ramani - (Subramanian.G) :)
When you ask VFP questions, please add VFP version.
 
Thanks Ramani.. that sure answered my question..
 
Thanks Mike. I wasn't aware of this fact.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top