Subject | RE: [firebird-support] FB 2.1 - new DB trigger feature with MON$ tables |
---|---|
Author | Leyne, Sean |
Post date | 2008-04-09T16:55:51Z |
Paul,
This new feature was intended to do stuff like that...
Sean
> In the application, aIt should be.
> 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?
This new feature was intended to do stuff like that...
Sean