Firebird Documentation IndexFirebird 2.1 Language Ref. UpdateContext variables → CURRENT_CONNECTION
Firebird Home Firebird Home Prev: Context variablesFirebird Documentation IndexUp: Context variablesNext: CURRENT_ROLE

CURRENT_CONNECTION

Available in: DSQL, PSQL

Added in: 1.5

Changed in: 2.1

Description: CURRENT_CONNECTION contains the unique identifier of the current connection.

Type: INTEGER

Examples: 

select current_connection from rdb$database
execute procedure P_Login(current_connection)

The value of CURRENT_CONNECTION is stored on the database header page and reset to 0 upon restore. Since version 2.1, it is incremented upon every new connection. (In previous versions, it was only incremented if the client read it during a session.) As a result, CURRENT_CONNECTION now indicates the number of connections since the creation – or most recent restoration – of the database.

Prev: Context variablesFirebird Documentation IndexUp: Context variablesNext: CURRENT_ROLE
Firebird Documentation IndexFirebird 2.1 Language Ref. UpdateContext variables → CURRENT_CONNECTION