Disconnect
Terminates access to the database.
Syntax
disconnect [current |connection_name |
session session_identifier | all]
Description
The disconnect statement terminates a session connected to a database with the connect statement. It does not disconnect the default connection specified with the -database flag. The disconnect statement commits any pending updates.
To disconnect the current session, issue the disconnect statement with no arguments, or the disconnect current statement; other sessions remain connected. To switch sessions, use the set_sql or set connection statement.
To disconnect a session other than the current session in a multi-session application, you must specify the session session_identifier clause or the connection name. (Connection names and session identifiers are specified using the connect statement.) To determine the numeric session identifier for the current session, use the inquire_sql(:session_id = session) statement. To determine the connection name for the current session, use the inquire_sql(connection_name) statement. If you specify an invalid session, Ingres issues an error and does not disconnect the session.
Use the disconnect all statement to disconnect all sessions started with the connect statement; that is, all sessions with positive session numbers. The disconnect all statement does not disconnect any Ingres‑generated sessions, including the initial or default session. Ingres‑generated sessions are disconnected when the application exits.
Permissions
This statement is available to any user.
Locking
When the disconnect is issued, all locks held are dropped.
Examples
Disconnect from the current database:
Disconnect;
Disconnect a session in a multi-session application by specifying the connection name"
Disconnect accounting;
Disconnect a session by specifying its session identifier.
Disconnect session 99;