Hi guys,
thanks for the suggestions and ideas, it helped to track it down.
It was not directly another trigger or procedure updating the record in question, but something similar :
I had altered an existing trigger. There was an if-block checking a field A for being not null and executing some code. I'd placed the new code inside of this if-block as I was sure, that the field A can't be null at this point and if it is, the new code doesn't need to be executed anyway. This wasn't correct though, because I'm setting this field A in my application in the AfterPost event of the dataset. So what happened was:
- first post (= after update trigger execution): my "somefield" (part of the new code) has actually changed, but the field A was still null -> no new code execution at all
- second post (= after update trigger): field A was not null anymore, but also my "somefield" (part of the new code) had the same new value in the new. and old. variables already -> no new code execution for the old value
Somehow I've thought that an after update trigger only fires once when all the changes have been made and comitted.
Placing the new code outside of the existing if-block works fine now. Thank you all for the help!
Posted by: patrick_marten@yahoo.com
| Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (10) |
Visit http://www.firebirdsql.org and click the Documentation item
on the main (top) menu. Try FAQ and other links from the left-side menu there.
Also search the knowledgebases at http://www.ibphoenix.com/resources/documents/
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
No comments:
Post a Comment