Subject Re: [firebird-support] Re: FB 2.1 - new DB trigger feature with MON$ tables
Author Dmitry Yemanov
Leyne, Sean wrote:
>
> Though, I think his message does bring forward a new/interesting feature
> request -- CREATE TRIGGER ... ON STATEMENT SUCCESS OR FAILURE
>
> Personally, though, I would never recommend creating a trigger on
> STATEMENT SUCCESS.
>
> What do you think of this?

I cannot imagine any usage scenario for SUCCESS :-) As for FAILURE, I'd
be more comfortable with a more generic things:

CREATE TRIGGER ON EXCEPTION [<specification>]

which could handle internal GDS exceptions as well as user-defined ones.

However, an implementation doesn't look trivial. Some errors are handled
by the engine behind the scene and never returned to the client. Also,
should this handler react on some non-user (i.e. system) activity like
background GC? What about parsing errors?


Dmitry