Subject Re: [firebird-support] connection context variable
Author Helen Borrie
At 02:32 AM 25/04/2005 +0000, you wrote:


>Is there a per-connection context variable available in Firebird to
>store a value (an integer or string value)? Say I need to store
>something on the server side to identify a certain attribute of each
>connection.

You have the read-only CURRENT_CONNECTION context variable from Fb 1.5
onward. You can store it at logon in a client variable that accepts a
64-bit integer. It will remain valid until the application detaches from
the connection. To determine what it is, just run a query like this, at
any time during the session:

select CAST(CURRENT_CONNECTION AS BIGINT) AS CONN_ID FROM RDB$DATABASE;

./hb