Show TOC

SET CONNECTION Statement [ESQL] [Interactive SQL]Locate this document in the navigation structure

Changes the active database connection.

Syntax
SET CONNECTION [<connection-name>]
Examples

(back to top)

  • Example 1 from dbisql, set the current connection to the connection named “conn1”:
    SET CONNECTION conn1
Usage

(back to top)

The current connection state is saved, and resumed when it again becomes the active connection. If you omit <connection-name>, but a connection exists, 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

(back to top)

  • SQL— dbisql use is a vendor extension to ISO/ANSI SQL grammar. Embedded SQL is a full-level feature.
  • SAP Database products—Supported by Open Client/Open Server.
Permissions