Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Trigger handling
Message
From
17/05/2005 11:10:26
Walter Meester
HoogkarspelNetherlands
 
 
To
15/05/2005 13:30:54
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 6
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01014364
Message ID:
01014935
Views:
15
Hi hilmar,

A trigger fails if the code the trigger refers to returns .F. it is the responsibility of the code to retain integrity. IFAIK, there is nothing in TAXRI that violates the integrity.

The best thing to do is to have the record buffered and do an explicit TABLEUPDATE() to save it. It will return false if it could not save it, and you could try again if you have detemined the problem. If you wish that the saving of the buffered record should go in sync with another action in another table (in order to ensure integrity), then you should use transactions to make sure that if one operation fails, they all fail.

HTH,

Walter





>What happens if a table has a trigger, and there is some problem when updating the record? Is the entire trigger supposed to be embedded in a transaction, which will undo any changes done in the trigger?
>
>More specifically, my problem is the following. I have a material reception / material delivery form, which will update the current stock - updating is done through a trigger. Under certain circumstances, the user gets an error message, "Update conflict", with the option "Retry?" I still have to investigate why exactly the error appears, and what exactly the framework (VFX) does, but I have the impression that the Retry will do a forced update.
>
>In this case, the data gets saved, but the stock is out of synch, meaning that there was some problem with the trigger.
>
>Of course, I will have to investigate and debug the framework code (the error seems to be easy to reproduce). But I also wanted to see if anybody could give me a clue about trigger handling in general, as explained in the first paragraph.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform