FirebirdSQL logo

RDB$GET_TRANSACTION_CN()

Returns the commit number (“CN”) of a transaction

Result type

BIGINT

Syntax
RDB$GET_TRANSACTION_CN (transaction_id)
Table 1. RDB$GET_TRANSACTION_CN Function Parameters
Parameter Description

transaction_id

Transaction id

If the return value is greater than 1, it is the actual CN of the transaction if it was committed after the database was started.

The function can also return one of the following results, indicating the commit status of the transaction:

-2

Transaction is dead (rolled back)

-1

Transaction is in limbo

 0

Transaction is still active

 1

Transaction committed before the database started or less than the Oldest Interesting Transaction for the database

NULL

Transaction number supplied is NULL or greater than Next Transaction for the database

Note

For more information about CN, consult theFirebird 4.0 Release Notes.

RDB$GET_TRANSACTION_CN Examples

select rdb$get_transaction_cn(current_transaction) from rdb$database;
select rdb$get_transaction_cn(123) from rdb$database;