Skip to Main Content
SQL in a Nutshell
book

SQL in a Nutshell

by Kevin Kline
December 2000
Intermediate to advanced content levelIntermediate to advanced
224 pages
9h 52m
English
O'Reilly Media, Inc.
Content preview from SQL in a Nutshell

Name

DISCONNECT

Synopsis

The DISCONNECT statement terminates a connection to the DBMS.

Vendor

Command

SQL Server

Supported, with limitations

MySQL

Not supported

Oracle

Supported, with variations

PostgreSQL

Not supported

SQL99 Syntax and Description

DISCONNECT {CURRENT | ALL | connection_name}

This command ends one or more connections created between the current SQL process and the database server. The CURRENT clause closes the currently active user connection. The ALL clause closes all open connections for the current user. Alternately, it’s possible to close only a specific connection.

Microsoft SQL Server Syntax and Variations

Microsoft SQL Server supports DISCONNECT in Embedded-SQL (ESQL) only, not within its ad hoc querying tool, SQL Query Analyzer. It supports the full SQL99 syntax. When disconnecting from Microsoft SQL Server in an ESQL program, the DISCONNECT ALL command should be used to disconnect cleanly from the database server.

Oracle Syntax and Variations

DISC[ONNECT]

In contrast to SQL Server, Oracle allows DISCONNECT only in its ad hoc query tool, SQL*Plus. In this usage, the command ends the current session with the database server but otherwise allows work in SQL*Plus to continue. For example, a programmer can continue to edit the buffer, save run files, and so on. However, a reconnection must be established to issue any SQL commands. Exiting SQL*Plus and returning to the filesystem requires the EXIT or QUIT commands.

Oracle also supports this functionality with ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

SQL in a Nutshell, 3rd Edition

SQL in a Nutshell, 3rd Edition

Kevin Kline

Publisher Resources

ISBN: 1565927443