- TO server-name or variable
- Identifies the application server by the specified server name or the server
name contained in the variable. If a variable is specified:
- It must be a character-string variable.
- It must not be followed by an indicator variable
- The server name must be left-justified within the variable and must conform
to the rules for forming an ordinary identifier
- If the length of the server name is less than the length of the variable,
it must be padded on the right with blanks.
- The value of the server name must not contain lowercase characters.
When the CONNECT statement is executed, the specified server name
or the server name contained in the variable must identify an application server described
in the local directory.
Let S denote the specified server name or the
server name contained in the variable. S must not identify an existing connection
of the application process.
- USER authorization-name or variable
- Identifies the authorization name that will be used to connect to the
application server.
If a variable is specified,
- It must be a character string variable.
- It must not be followed by an indicator variable. The authorization name
must be left-justified within the variable and must conform to the rules of
forming an authorization name.
- If the length of the authorization name is less than the length of the
variable, it must be padded on the right with blanks.
- USING password or variable
- Identifies the password that will be used to connect to
the application server.
If password is specified as a literal, it must be
a character string. The maximum length is 128 characters. It must be left
justified. The literal form of the password is not allowed in static SQL or
REXX.
If a variable is specified,
- It must be a character-string variable.
- It must not be followed by an indicator variable.
- The password must be left-justified within the variable.
- If the length of the password is less than that of the variable, it must
be padded on the right with blanks.
- RESET
- CONNECT RESET is equivalent to CONNECT TO x where x is the local server name.
- CONNECT with no operand
- This form of the CONNECT statement returns information about the current
server and has no effect on connection states, open cursors, prepared statements,
or locks. The connection information is returned in the connection information
items in the SQL Diagnostics Area (or the SQLCA).
In addition, the DB2_CONNECTION_STATUS
connection information item in the SQL Diagnostics Area (or the SQLERRD(3)
field of the SQLCA) will indicate the status of connection for this unit of
work. It will have one of the following values:
- 1 - Commitable updates can be performed on the connection for this unit
of work.
- 2 - No commitable updates can be performed on the connection for this
unit of work.
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.