Subject | Re: triggers not working |
---|---|
Author | Adam |
Post date | 2005-02-16T13:33:38Z |
--- In firebird-support@yahoogroups.com, Thomas Steinmaurer <ts@i...>
The triggers will fire at the moment you execute a query. Even if you
eventually rollback, the trigger has fired, but because the stuff the
trigger does occurs within the context of your transaction, if you
rollback, the changes made by the trigger are also rolled back. In
other words, you do not need to commit the transaction the DML
statement is in to fire the trigger (possibly confusing it with events).
Adam
> > Forgive my ignorance regarding how ibo / delphi datasets work, but ifHmmm, that is a bit confusing and potentially misleading.
> > it's a 'before insert' trigger, if I do an query.insert in delphi and
> > then a query.cancel, I presume the trigger won't have fired?
>
> A trigger will fire when you commit the transaction in which the DML
> statement was executed. No COMMIT = the trigger won't fire.
>
The triggers will fire at the moment you execute a query. Even if you
eventually rollback, the trigger has fired, but because the stuff the
trigger does occurs within the context of your transaction, if you
rollback, the changes made by the trigger are also rolled back. In
other words, you do not need to commit the transaction the DML
statement is in to fire the trigger (possibly confusing it with events).
Adam