Subject Re: Triggers
Author Alexander V.Nevsky
--- In firebird-support@yahoogroups.com, Mahesh Ishwar
<meghanshic@y...> wrote:
> Thanx for ur prompt response.
> In my existing Oracle database, I've to write a statement level
trigger becoz of th eproblem of mutating table restriction describe as
under :

Mahesh, Firebird have no such a limitation, you can access for read
and write table on it's row level triggers, even the same row with
the same operation. Struggle against recursion is on your conscience.
Unlimited recursion leads to server crash and can cause database
corruption at this moment.

> I just wanted to know is this possible in Firebird that a trigger
which is evoked after an insert in a row does some calculation on some
other tables and then deletes this row itself?

I make this on after update (Update Set Deleted='Y' -> AU trigger
writes record into log and delete it). Did'nt tried with after insert.
Just try it with test table and you will know :) I can't recall
exactly, but there was bug, seems related to attempts to delete record
itself in Before triggers. It was fixed but I can't recall in which
version, if you are interested, check bug tracker at sourceforge.
About statement level triggers - FB don't have them, but it have
Events - notification of interested client application. Events are
raised in row level triggers and sent to client on transaction's
commit. If there were many identical events during transaction's life
(Table A updated for example), client gets one.

Best regards, Alexander.