Database connections / Multi-session mode connection instructions |
Selects the current session when in multi-session mode.
SET CONNECTION { { session | DEFAULT } [DORMANT] | CURRENT DORMANT }
The SET CONNECTION instruction makes a given connection current.
The session name is case-sensitive.
When using the DEFAULT keyword, it identifies the default database server connection established with a CONNECT TO DEFAULT or a DATABASE instruction. This clause is specific to IBM® Informix® databases.
To make the current connection dormant, use CURRENT DORMANT keyword. This clause is specific to IBM Informix databases.
A SET CONNECTION statement cannot be executed with dynamic SQL (i.e. PREPARE + EXECUTE).
MAIN CONNECT TO "stores1" CONNECT TO "stores1" AS "SA" CONNECT TO "stores2" AS "SB" SET CONNECTION "stores1" -- Select first session SET CONNECTION "SA" -- Select second session SET CONNECTION "stores1" -- Select first session again END MAIN