Contents IndexSET statement SET DESCRIPTOR statement

User's Guide
   Part VI. SQL Anywhere Reference
     Chapter 43. Watcom-SQL Statements
      SET CONNECTION statement

Function

To change the active database connection.

Syntax

     SET CONNECTION [connection-name]

Parameters

     connection-name:

         identifier, string or host-variable

Usage

ISQL.

Permissions

None.

Side effects

None.

See also

Description

The SET CONNECTION statement changes the active database connection to connection-name. The current connection state is saved and will be 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.

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

Example

The following example is in Embedded SQL.

     EXEC SQL SET CONNECTION :conn_name;

Example

From ISQL, set the current connection to the connection named conn1.

     SET CONNECTION conn1 ;

Contents IndexSET statement SET DESCRIPTOR statement