CURRENTSERVER bind option

The CURRENTSERVER option determines the location to connect to before running a plan.

Command option Option values Used with
CURRENT SERVER
  • (location-name)

The column CURRENTSERVER in catalog table SYSPLAN records the value of location-name. The special register CURRENT SERVER also receives that value at the server when the plan is allocated.

You can use CURRENTSERVER to cause a local application to use data from a remote server without changing the application; however, using CURRENTSERVER causes poor performance and should be avoided where possible. Avoid using CURRENTSERVER with applications that contain explicit CONNECT statements.

Option descriptions for CURRENTSERVER

CURRENTSERVER(location-name)
he name of the location to connect to. The catalog table SYSIBM.LOCATIONS must contain this name. If the table does not exist, if the table does not contain the DBMS, or if there are no packages at that location, warning messages occur.

SQL return codes for CURRENTSERVER

The CURRENTSERVER bind option causes Db2 to execute a CONNECT statement. Db2 does not display or report to the application program any warnings that this CONNECT returns. To display the warnings, use explicit CONNECT statements rather than the CURRENTSERVER bind option.

Default values for CURRENTSERVER

Process Default value
BIND PLAN Local database system (regardless of the name of the local location)
BIND PACKAGE N/A
REBIND PLAN Existing value
REBIND PACKAGE N/A

Catalog records for CURRENTSERVER

See the CURRENTSERVER column in SYSPLAN catalog table.