CONNX Data Integration Suite 14.8.0 | CONNX Embedded SQL for Adabas | Standard SQL Statements | SET CONNECTION
 
SET CONNECTION
Function
The SET CONNECTION statement is used to specify which database connection to use for subsequent SQL statements.
Invocation
Embedded Mode P Dynamic Mode Interactive Mode P
Syntax
The syntax is SET CONNECTION connection_name.
Description
The value for connection_name must match the connection name of an existing database connection specified in a previous CONNECT TO statement.
The connection_name can be either a literal, or a host variable.
ANSI Specifics
The SET CONNECTION statement is not part of the ANSI standard.
Adabas SQL Gateway Embedded SQL Specifics
None.
Example:
EXEC SQL CONNECT TO EMPLOYEES AS S1 USER U1;
EXEC SQL CONNECT TO VEHICLES AS S2 USER U1;
EXEC SQL SET CONNECTION 'S1';
EXEC SQL SELECT PERSONNEL_ID FROM EMPLOYEES INTO :PERSONNEL_ID;
EXEC SQL SET CONNECTION 'S2';
EXEC SQL SELECT MAKE FROM VEHICLES INTO :MAKE;
EXEC SQL DISCONNECT 'S1';
EXEC SQL DISCONNECT 'S2';