8. SQL Statements : CONNECT : Creating Multiple Sessions : Using Session Identifiers
 
Share this page                  
Using Session Identifiers
To assign a numeric session identifier to a connection, specify the session clause. For example:
EXEC SQL CONNECT accounting SESSION 99;
assigns the numeric session identifier 99 to the connection to the accounting database. To determine the session identifier for the current session, use the INQUIRE_SQL(SESSION) statement.
To switch sessions using the numeric session identifier, use the SET_SQL(SESSION) statement. For example:
EXEC SQL SET_SQL(SESSION = 99);