CONNECT statement with RD-node specification (Connect to distributed RD-node)

Function

The CONNECT statement with an RD-node specification reports an authorization identifier and a password to a distributed RD-node in order to connect the UAP to the distributed RD-node. When connection is made, the connected RD-node is designated as the current RD-node.

Privileges

For the authorization identifier that links to the specified RD-node, the user needs the privilege to connect to the system using the RD-node. For the privilege necessary to connect to the system using a specified RD-node, see the system manual for the RD-node.

Format

CONNECT TO {RD-node-name|:embedded-variable-1}
[USER:embedded-variable-2 [USING:embedded-variable-3]]

Operands

RD-node-name
Specifies the name of the RD-node to which connection is to be made.
embedded-variable-1
Specifies an embedded variable that contains as its value the name of the RD-node to which connection is to be made.
If the UAP is written in C, specify a fixed-length character string of up to 31 bytes, the final character of which is the null value. If the character string does not terminate with the null value, the character string occupying (area length - 1) is used as the RD-node name.
If the UAP is written in COBOL, specify a fixed-length character string of up to 30 bytes; this character string need not terminate with the null value.

Specifies an embedded variable that contains as its value the authorization identifier for linking to the RD-node to which connection is to be made.

If the UAP is written in C, specify a fixed-length character string of up to 31 bytes, the final character of which is the null value. If the character string does not terminate with the null value, the character string occupying (area length - 1) is used as the authorization identifier.

If the UAP is written in COBOL, specify a fixed-length character string of up to 30 bytes; this character string need not terminate with the null value.

If all operands following USER are omitted, the same authorization identifier and password as were used for the existing RD-node connection will be reported to the RD-node to which connection is to be made.

If values are to be case-sensitive, they must be enclosed in double quotation marks (").

Specifies an embedded variable that contains as its value the password for linking to the RD-node to which connection is to be made.

If the UAP is written in C, specify a fixed-length character string of up to 31 bytes, the final character of which is the null value. If the character string does not terminate with the null value, the character string occupying (area length - 1) is used as the password.

If the UAP is written in COBOL, specify a fixed-length character string of up to 30 bytes; this character string need not terminate with the null value.

If passwords are not required for users, either omit the USING clause or specify any character string in the embedded variable.

Common rules

  1. The existing RD-node cannot be specified as the RD-node to which connection is to be made (the existing RD-node means the local RD-node specified in the single-server definition or front-end server definition).
  2. Connection cannot be made simultaneously to multiple distributed RD-nodes.
  3. A CONNECT statement with an RD-node specification cannot be executed for connection to the already connected distributed RD-node. Also, if HiRDB has connected automatically to a distributed RD-node by means of execution of an SQL statement that includes a table alias, a CONNECT statement with an RD-node specification cannot be executed for connection to that RD-node.
  4. When the CONNECT statement with an RD-node specification terminates normally, the specified RD-node becomes the current RD-node.
  5. If execution of the CONNECT statement with an RD-node specification terminates with an error, the current RD-node remains unchanged.
  6. If a CONNECT statement with an RD-node specification is issued without first connecting to the existing RD-node, before connection is established with the specified RD-node, a connection is established automatically to the existing RD-node, using the authorization identifier and password that are specified in the PDUSER client environment variable.

Note

  1. Once a connection is established to an RD-node by the CONNECT statement with an RD-node specification, that RD-node becomes the current RD-node. If the current RD-node is a nonexistent node, SQL statements that include table aliases and table names qualified with the RD-node name cannot be used. If such an SQL statement is issued, it is transmitted to the current RD-node in the form that includes table aliases or table names that are qualified with the RD-node name, so it will not execute successfully.

Example

Report an authorization identifier (embedded variable USER2) and a password (embedded variable PSWD2) in order to connect to the RD-node named RDNODE10:

CONNECT TO RDNODE10 USER :USER2 USING :PSWD2