Progress
Embedded SQL-92
Guide and Reference
DISCONNECT Statement
The DISCONNECT statement terminates the connection between an application and the database to which it is connected:
connection_name
Disconnects the named database. If there is also an established connection to the
DEFAULT
database, the connection to theDEFAULT
database becomes the current connection. If there is noDEFAULT
database, there is no current connection after the SQL engine processes theDISCONNECT
.CURRENT
Disconnects the
CURRENT
database. f there is also an established connection to theDEFAULT
database, the connection to theDEFAULT
database becomes the current connection. If there is noDEFAULT
database, there is no current connection after the SQL engine processes theDISCONNECT
.ALL
Disconnects all established connections. After you issue
DISCONNECT ALL
, there is noCURRENT
connection.DEFAULT
Terminates the connection to the
EXAMPLESDEFAULT
database. If this connection is the current connection, there is no current connection after this DISCONNECT statement is executed.The first example illustrates CONNECT TO AS ’connection_name’ and DISCONNECT ’connection_name’:
This example illustrates CONNECT TO DEFAULT and DISCONNECT DEFAULT:
When you specify the ALL option, all established connections are disconnected. After you issue DISCONNECT ALL there is no current connection. For example:
The following example illustrates these steps:
- CONNECT TO ’connect_string’ AS ’connection_name’ establishes a connection to the database in the connect_string; the connection has the name ’conn_1’.
- CONNECT TO DEFAULT establishes a connection to the DEFAULT database and sets this connection current.
- DISCONNECT DEFAULT disconnects the connection to the DEFAULT database.
- SET CONNECTION ’conn_1’ sets the ’conn_1’ connection current.
- DISCONNECT CURRENT disconnects the ’conn_1’ connection.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |