SET CONNECTION
- Last Updated: January 17, 2024
- 1 minute read
- OpenEdge
- Version 12.8
- Documentation
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
|
Parameters
- connection_name
-
The name of the connection as either a character literal or host variable. If the
SET CONNECTIONstatement omits a connection name, the default is the name of the database. Connection names must be unique. - DEFAULT
-
Sets the
DEFAULTconnection as the current connection.
Example
The first example shows how to establish a database as the current database:
|
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:
|
See also the last example for the DISCONNECT statement,
which illustrates the CONNECT, SET CONNECTION,
and DISCONNECT statements in combination.