CURRENT_CONNECTION

<< SQL user management commands | FB 2.5 Language Reference | CURRENT_ROLE >>
<< Context variables | FB 2.1 Language Reference | 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.

back to top of page
<< SQL user management commands | FB 2.5 Language Reference | CURRENT_ROLE >>
<< Context variables | FB 2.1 Language Reference | CURRENT_ROLE >>