DISCONNECT statement [DBISQL]

Description

Drops a connection with the database.

Syntax

DISCONNECT [ { connection-name | CURRENT | ALL } ]

Parameters

connection-name:

identifier, string, or host-variable

Examples

Example 1

The following statement shows how to use DISCONNECT in Embedded SQL:

EXEC SQL DISCONNECT :conn_name

Example 2

The following statement shows how to use DISCONNECT from DBISQL to disconnect all connections:

DISCONNECT ALL

Usage

The DISCONNECT statement drops a connection with the database server and releases all resources used by it. If the connection to be dropped was named on the CONNECT statement, then the name can be specified. Specifying ALL drops all of the application’s connections to all database environments. CURRENT is the default and drops the current connection.

An implicit ROLLBACK is executed on connections that are dropped.


Side effects

None.

Standards

Permissions

None

See also

CONNECT statement [ESQL] [DBISQL]

SET CONNECTION statement [DBISQL] [ESQL]