Release 10.1A: OpenEdge Data Management:
SQL Reference

> ## SET CONNECTION

> Switches the application from one established connection to another. This resumes the connection associated with the specified `connection_name`, restoring the context of that database connection to the same state it was in when suspended.

> #### Syntax

>     SET CONNECTION { 'connection_name' | DEFAULT } ;

> `connection_name`

> The name of the connection as either a character literal or host variable. If the `SET CONNECTION` statement omits a connection name, the default is the name of the database. Connection names must be unique.

> `DEFAULT`

> Sets the `DEFAULT` connection as the current connection.

> Examples

> The first example shows how to establish a database as the current database:

>     EXEC SQL
>          SET CONNECTION 'conn_1' ;

> The `SET CONNECTION` command sets the database associated with the connection named `conn_1` to the status of current database. The connection named `conn_1` must be associated with an established connection. Use `SET CONNECTION DEFAULT` to set current the database associated with the `DEFAULT` connection. In this example, the statement suspends the `conn_1` connection, which had been current:

>     EXEC SQL
>          SET CONNECTION DEFAULT ;

> See also the last example for the `DISCONNECT` statement, which illustrates the `CONNECT`, `SET CONNECTION`, and `DISCONNECT` statements in combination.

> ##### Authorization

> None

> ##### Related statements

> CONNECT, DISCONNECT

Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095