This statement can only be embedded in an application program, except in REXX programs. It is an executable statement that cannot be dynamically prepared.
None required.
SET CONNECTION {location-name | host-variable}
Execute SQL statements at TOROLAB1, execute SQL statements at TOROLAB2, and then execute more SQL statements at TOROLAB1.
EXEC SQL CONNECT TO TOROLAB1;
(execute statements referencing objects at TOROLAB1)
EXEC SQL CONNECT TO TOROLAB2;
(execute statements referencing objects at TOROLAB2)
EXEC SQL SET CONNECTION TOROLAB1;
(execute statements referencing objects at TOROLAB1)
The first CONNECT statement creates the TOROLAB1 connection, the second CONNECT statement places it in the dormant state, and the SET CONNECTION statement returns it to the current state.
Description
Identifies the SQL connection by the specified location name or the location name contained in the host variable. If a host variable is specified:
Let S denote the specified location name or the location name contained in the host variable. S must identify an existing SQL connection of the application process. If S identifies the current SQL connection, the state of S and all other connections of the application process are unchanged. The following rules apply when S identifies a dormant SQL connection.
If the SET CONNECTION statement is successful:
One of:
is a two-digit version identifier such as '06'.
is a two-digit release identifier such as '01'.
is a one-digit modification level such as '0'.
For example, if the server is Version 6 of DB2 for OS/390 with the latest maintenance, the value of SQLERRP is 'DSN06011'. Any previously current SQL connection is placed in the dormant state.
If the SET CONNECTION statement is unsuccessful, the connection state of the application process and the states of its SQL connections are unchanged.