With DISCONNECT
Go Up to Closing a Database
To close all open databases by disconnecting from them, use the following DISCONNECT
syntax:
EXEC SQL DISCONNECT {ALL | DEFAULT};
For example, each of the following statements closes all open databases in a
program:
EXEC SQL DISCONNECT ALL; EXEC SQL DISCONNECT DEFAULT;
To close specific databases, specify their handles as comma-delimited parameters, using the following syntax:
EXEC SQL DISCONNECT handle [, handle ...];
For example, the following statement disconnects from two databases:
EXEC SQL DISCONNECT DB1, DB2;
- Note: A database should not be closed until all transactions are finished with it, or it must be reopened and its resources reallocated.