The contents of the CONNECTION_NAME field

The CONNECTION_NAME field contains connection information that depends on the previously executed CONNECT, SET CONNECTION, DISCONNECT, or DISCONNECT ALL statement.

The CONNECTION_NAME field contains different information after you execute the following statements.

Executed Statement
Contains the name, as specified in the CONNECT statement, of the connection to which you connect or fail to connect. The field is blank for no current connection or a default connection.
Contains the name, as specified in the SET CONNECTION statement, of the connection to which you switch or fail to switch.
Contains the name, as specified in the DISCONNECT statement, of the connection from which you disconnect or fail to disconnect. If you disconnect successfully, and then execute a DISCONNECT statement for a connection that is not current, the CONNECTION_NAME field remains unchanged.
Contains no information if the DISCONNECT ALL statement executes successfully. If the statement does not execute successfully, the CONNECTION_NAME field contains the names of all the connections specified in your CONNECT statements from which you did not disconnect. This information does not mean, however, that the connection still exists.
If CONNECT is successful, CONNECTION_NAME takes one of these values:
  • The name of the database environment as specified in the CONNECT statement if the CONNECT statement does not include the AS clause
  • The name of the connection (the identifier that was declared after the AS keyword) if the CONNECT statement includes the AS clause