Explicitly Connecting to a Server

Use the following form of SQL CONNECT to establish the current server for the client application process. The current server must be a valid server or a valid Db2 subsystem.

EXEC SQL CONNECT TO :host variable 
EXEC SQL CONNECT TO location

where:

host variable

Is a host variable.

location

Is an explicit location. For the explicit designation of the current server, the location name must be a valid server or a valid Db2 subsystem.

  • To be a valid server, its definition must reside under the communications configuration file.
  • For a valid Db2 subsystem, the Extender for Db2 does not recognize any local or remote Db2 subsystems, but passes the CONNECT request to Db2, for Db2 to make the validation. In this manner, remote Db2 subsystems can be connected to the Extender for Db2, provided that the local Db2 subsystem, which the Extender for Db2 was originally link-edited at installation can recognize the remote Db2 subsystem name.

Upon a COMMIT or ROLLBACK, the Extender for Db2 resolves and dispatches partially-qualified table requests to the current server.

Use the explicit form of SQL CONNECT whenever partially-qualified tables must be resolved to a Server for Db2 or to a server.

WebFOCUS

Feedback