Subject Re: Problem with triggers
Author Marco Menardi
--- In IBObjects@yahoogroups.com, "Eric Tishler" <etishler@r...> wrote:
> I run a transaction that performs an update on a specific table.
What I am really doing is adding credits to a user balance. In the
database this table has an AU (After Update) trigger that should take
the updated balance and update a corresponding record in another table.
>
> For some reason the first table is getting update just fine from my
code. However the trigger does not seem to be kicking in and updating
the second table.
>
> Is there something else special I have to do from my code to ensure
that any associated triggers are invoked as is appropriate?
>
> I always thought that triggers are stupid and just react to events
and that that do not care if an Insert/Update/Delete takes place
directly in the database or through code. (A Delphi application in
this case using IB Objects)
>
There nothing you have to do from the client side to have triggers...
triggered. I suspect that you have a wrong designed or implemented
trigger.
I'm using the trigger logic also for account purposes and works very well.
a) make sure your trigger is fired: add an exception on it and see if
an exception is rised
b) make sure that your trigger code is correct (i.e. you are not
making an update with a search criteria that founds NO rows to update)

Best regards
Marco Menardi