SET CONNECTION Statement [ESQL] [Interactive SQL]

Changes the active database connection.

Syntax

SET CONNECTION [connection-name]

Parameters

Examples

Usage

The current connection state is saved and is resumed when it again becomes the active connection. If connection-name is omitted and there is a connection that was not named, that connection becomes the active connection.

Note: When cursors are opened in Embedded SQL, they are associated with the current connection. When the connection is changed, the cursor names are not accessible. The cursors remain active and in position and become accessible when the associated connection becomes active again.

Standards

  • SQL— dbisql use is a vendor extension to ISO/ANSI SQL grammar. Embedded SQL is a full-level feature.

  • Sybase—Supported by Open Client/Open Server.

Permissions

None

Related reference
CONNECT Statement [ESQL] [Interactive SQL]
DISCONNECT Statement [Interactive SQL]