Subject Re: [firebird-support] Need help on getting transaction id
Author Helen Borrie
At 11:07 AM 5/09/2003 +0000, you wrote:
>Hi all,
>
>
>I need some help on getting transaction ID in body of trigger.
>
>(it does not have to be actual ID but kind of unique ID for every
>transaction (like generator value) datatype Int32).
>
>I tried all sort of tricks with temporary tables and transaction
>visibility
>but nothing works ...
>
>I am making a user/table activity logging system and need to record
>unique
>transaction ID (so I can determine
>group of operations that was done in same transaction).
>
>Thanks in advance,

In Firebird 1.5, the current transaction ID is available in the context
variable CURRENT_TRANSACTION:

insert into YourLogTable (TransID, Whatever)
values (CURRENT_TRANSACTION, 'somedata');

Internal transaction ids are unique only within a single backup/restore cycle.

heLen