On this page
DISCONNECT
Closes the current connection; returns to the previous one with RememberLastConnection=TRUE, otherwise to BroadSQL>.
Syntax
DISCONNECT [API]
Quick start
CONNECT WORLD;
BYE;
Opens WORLD, then closes it: the prompt is BroadSQL> again (with the default RememberLastConnection=FALSE).
Arguments
| Argument | Required | Values | Default |
|---|---|---|---|
API | No | Clears only the API session context | Closes the database connection |
Examples
DISCONNECT;
BYE;
DISCONNECT API;
Example session
[Enter password]
Restoring the last connection, A (RememberLastConnection=TRUE)...
A>
Details
Database connection
DISCONNECT, and its aliases BYE and CLOSE, close the current database connection: pending work is committed with autocommit on, rolled back (with a warning) otherwise, and the connection is released. What follows depends on the RememberLastConnection setting.
FALSE(the default): BroadSQL is then not connected to any database; the prompt isBroadSQL>.TRUE: BroadSQL returns to the connection that was active before this one in the session, opened exactly asCONNECTopens it. EachDISCONNECTgoes one step back; when there is no previous connection, or it cannot be opened (the reason is shown), the prompt isBroadSQL>. Only successful connection changes (CONNECT,ENV) count, never a failed one, and never the CDF.
BroadSQL never returns to the CDF by itself. DISCONNECT in CDF maintenance mode ends it and closes the CDF. Without a connection, DISCONNECT only says so.
API session context
DISCONNECT API clears only the API session context set by CONNECT API; the database connection is not touched. Without an API context, it does nothing.
Related
- CONNECT
- LOGOUT: ends the authenticated session, not only the connection
- Starting, connecting and logging out:
RememberLastConnectionand the connection history - Connections
Last modified in release development.
Found something wrong or unclear on this page? Tell us, with the page address.