ALLBASE/SQL Reference Manual (36216-90216)

Chapter 10 391
SQL Statements A - D
DISCONNECT
DISCONNECT
The DISCONNECT statement terminates a connection with a DBEnvironment or terminates
all DBEnvironment connections established within an application or an ISQL session.
Scope
ISQL or Application Programs
SQL Syntax
DISCONNECT {‘
ConnectionName
DBEnvironmentName
:
HostVariable
ALL
CURRENT }
Parameters
ConnectionName
is a string literal identifying the name associated with this connection.
ConnectionName
must be unique for each DBEnvironment connection
within an application (or ISQL).
ConnectionName
cannot exceed 128
bytes.
'
DBEnvironmentName
' is the DBEnvironment to which you have connected to using a
CONNECT TO '
DBEnvironmentName
' statement.
HostVariable
is a character string host variable containing the
ConnectionName
associated with this connection.
ALL specifies that all DBEnvironment connections in effect (for an application
or an ISQL session) are to be terminated.
CURRENT specifies that the current connection is to be terminated. Within an
application (or ISQL), the current connection to a DBEnvironment is
set by the most recent statement that connects to or sets the connection to
the DBEnvironment. If there is no current connection in effect, an error is
generated.
Description
If a
ConnectionName
refers to a DBEnvironment that is not the one associated with
the current connection, the specified connection is terminated, and the context of the
currently connected DBEnvironment remains unchanged.
Any active transaction associated with a connection is rolled back before the connection
is terminated.
No stored section is created for the DISCONNECT statement. DISCONNECT cannot be
used with the PREPARE or EXECUTE IMMEDIATE statements.
An active transaction is not required to execute a DISCONNECT statement. An