The DISCONNECT StatementThe DISCONNECT statement terminates the connection between an application and a database. For example, to disconnect the connection associated with the connection name conn_1, the c-treeSQL statement would be: EXEC SQL DISCONNECT 'conn_1' ; If the DISCONNECT statement specifies the current connection, then c-treeSQL makes the connection to the default database (made through an earlier CONNECT TO DEFAULT statement) the current connection. Otherwise, there is no current connection. To disconnect all connections, the statement would be: EXEC SQL DISCONNECT ALL; When the option ALL is specified, all established connections are disconnected. After the execution of this statement, a current connection does not exist. To disconnect the current connection, the statement would be: EXEC SQL DISCONNECT CURRENT; When the option CURRENT is specified, the current connection, if any, is disconnected. Here too, the connection to the default database, if any, is made the current connection; otherwise, no current connection exists. To disconnect the default connection, the statement would be: EXEC SQL DISCONNECT DEFAULT; If the default connection happens to be the current connection, there is no current connection after a DISCONNECT DEFAULT statement. |
|||