Subject RE: [firebird-support] FB 2.1 - new DB trigger feature with MON$ tables
Author Leyne, Sean
Paul,

> In the application, a
> good transaction is committed, and an exception is rolled
> back. So I did the following:
>
> CREATE TRIGGER DATALOGGER
> ACTIVE ON TRANSACTION ROLLBACK POSITION 0 AS BEGIN
> INSERT INTO BADSQL(SQLTIME, SQLCMD)
> SELECT CURRENT_TIMESTAMP, M.MON$SQL_TEXT
> FROM MON$STATEMENTS M
> WHERE M.MON$TRANSACTION_ID = CURRENT_TRANSACTION; END
>
> I figured this would allow me to check a user's database and
> find out why they reported an error. Unfortunately it never
> works. The MON$TRANSACTION_ID is always null.
>
> Is this possible to do?

It should be.

This new feature was intended to do stuff like that...


Sean