Example

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.