Progress
SQL-92
Guide and Reference
DISCONNECT Statement
Terminates the connection between an application and the database to which it is connected.
SYNTAX
connection_name
The name of the connection as either a character literal or host variable. See the CONNECT Statement for more information on the connection_name.
CURRENT
Disconnects the current connection.
ALL
Disconnects all established connections.
DEFAULT
Disconnects the connection to the default database.
EXAMPLESThe first example illustrates CONNECT TO AS 'connection_name' and DISCONNECT 'connection_name'.
This example illustrates CONNECT TO DEFAULT and DISCONNECT DEFAULT:
This example disconnects all database connections. After you issue DISCONNECT ALL there is no current connection.
The following example illustrates the CONNECT, SET CONNECTION, and DISCONNECT statements in combination using these steps:
- CONNECT TO 'connect_string' AS 'connection_name' which establishes a connect_string connection to the database in the 'connect_string'; the connection has the name 'conn_1'
- CONNECT TO DEFAULT which establishes a connection to the DEFAULT database and sets this connection current
- DISCONNECT DEFAULT which disconnects the connection to the DEFAULT database
- SET CONNECTION 'connection_name' which sets the 'conn_1' connection current
- DISCONNECT CURRENT which disconnects the 'conn_1' connection
This example illustrates connection management statements in combination:
NOTES
- When you specify DISCONNECT 'connection_name' or DISCONNECT CURRENT and there is also an established connection to the DEFAULT database, the connection to the DEFAULT database becomes the current connection. If there is no DEFAULT database there is no current connection after the SQL engine processes the DISCONNECT.
- The DISCONNECT DEFAULT statement terminates the connection to the DEFAULT database. If this connection is the current connection, there is no current connection after this DISCONNECT statement is executed.
AUTHORIZATION
None
SQL COMPLIANCE
SQL-92
ENVIRONMENT
Embedded SQL only
RELATED STATEMENTS
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |