CONNECT statement (Connect a UAP to HiRDB)

Function

The CONNECT statement passes the authorization identifier and password to HiRDB, enabling the UAP to use HiRDB. This operation is referred to as connecting a UAP to HiRDB.

Privileges

User with the DBA or CONNECT privilege

A user with the DBA or CONNECT privilege can connect a UAP to HiRDB.

Format

CONNECT [{USER:embedded-variable-1[USER:embedded-variable-2]
         | :embedded-variable-1[IDENTIFIED BY :embedded-variable-2]}]

Operands

embedded-variable-1
Specifies an embedded variable whose value is an authorization identifier.
If the UAP is written in C, this variable's data type must be a fixed-length character string of no more than 31 bytes that terminates with the null value. If the character string does not end with the null value, the character string whose length is (area length - 1) is used as the authorization identifier.
If the UAP is written in COBOL, this operand is of the fixed-length character string data type with a length of 30 bytes or less. The character string does not need to end with the null value.
If the CONNECT statement is specified but all operands after USER are omitted, the UAP is connected to HiRDB using the value set in the PDUSER environment variable as the authorization identifier.
When embedded-variable-1 is specified as a case-sensitive variable, it must be enclosed in quotation marks (").
embedded-variable-2
Specifies an embedded variable whose value is a password.
If the UAP is written in C, this variable's data type must be a fixed-length character string of no more than 31 bytes that terminates with the null value. If the character string does not end with the null value, the character string whose length is (area length - 1) is used as the password.
If the UAP is written in COBOL or OOCOBOL, this operand is of the fixed-length character string data type with a length of 30 bytes or less. The character string does not need to end with the null value.
In the case of a user who does not have a password, either the USING clause and the IDENTIFIED BY clause should be omitted or any character string should be specified in the embedded variable.

Common rule

A UAP cannot be reconnected to HiRDB before it has been disconnected from HiRDB with the DISCONNECT statement.

Note

The CONNECT statement cannot be specified from an X/Open-compliant UAP running under OLTP.

Example

Connect a UAP to HiRDB by passing to HiRDB the user's authorization identifier (embedded variable USER1) and password (embedded variable PSWD1):

CONNECT USER :USER1 USING :PSWD1