Was this helpful?
DISCONNECT
Valid in: ESQL
Terminates access to the database.
The DISCONNECT statement has the following format:
EXEC SQL DISCONNECT [SESSION session_identifier | ALL]
session_identifier
Disconnects the specified session in a multi‑session application. The session_identifier must be a positive integer constant or variable containing the session identifier. To determine the session_identifier for the current session, use the INQUIRE_SQL(:session_id = SESSION) statement. If an invalid session is specified, OpenSQL issues an error and does not disconnect the session.
ALL
Disconnects all open sessions.
The DISCONNECT statement terminates access to the database, closes any open cursors, and commits any open transactions.
To disconnect the current session, issue the DISCONNECT statement, omitting the session identifier. Other sessions (if any) will remain connected. To switch sessions, use the SET_SQL statement.
Last modified date: 11/28/2023