Switch between multiple database connections

The Informix® ESQL/C application can make a number of simultaneous database connections with a CONNECT statement. These connections can be to several database environments or can be multiple connections to the same database environment. To switch between connections, the Informix ESQL/C application must follow these steps:
  1. Establish a connection with the CONNECT STATEMENT
  2. Handle any active transactions

    If the current connection has an active transaction, you can switch connections only if the CONNECT statement with the WITH CONCURRENT TRANSACTION clause establishes the current connection.

  3. Make a connection current with the SET CONNECTION or CONNECT statement