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

CURRENT_CONNECTION

Tip

Find a more recent version at Firebird 5.0 Language Reference: CURRENT_CONNECTION

Available in: DSQL, PSQL

Added in: 1.5

Description: CURRENT_CONNECTION returns a unique identifier for 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 upon restore. Since the engine itself is not interested in this value, it is only incremented if the client reads it during a session. Hence it is only useful as a unique identifier, not as an indicator of the number of connections since the creation or latest restoration of the database. Please note that this will change in Firebird 2.1.

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