Causes the specified existing connection to become the current connection.
set connection {connection_name | DEFAULT};
The name of an existing connection that you want to become the current connection.
Specifies that the unnamed default connection is to become the current connection.
exec sql connect "ME" at connect1 using "SERVER1";
exec sql connect "ME" at connect2 using "SERVER2";
/* The next statement executes on connect2. */
exec sql select userid() into :myid;
exec sql set connection connect1;
/* The next statement executes on connect1. */
exec sql select count(*)from t1;
The set connection statement specifies the current connection for all subsequent SQL statements, except those preceded by the exec sql clause at.
A set connection statement remains in effect until you choose a different current connection by using the set connection statement again.
at connection_name, connect