On this page

DISCONNECT

Core command BYE CLOSE

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

ArgumentRequiredValuesDefault
APINoClears only the API session contextCloses the database connection

Examples

DISCONNECT;
BYE;
DISCONNECT API;

Example session

[Enter password]
Restoring the last connection, A (RememberLastConnection=TRUE)...
A>
Startup with RememberLastConnection=TRUE

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 is BroadSQL>.
  • TRUE: BroadSQL returns to the connection that was active before this one in the session, opened exactly as CONNECT opens it. Each DISCONNECT goes one step back; when there is no previous connection, or it cannot be opened (the reason is shown), the prompt is BroadSQL>. 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.

Last modified in release development.

Found something wrong or unclear on this page? , with the page address.