7.5.13 DISCONNECT

Table of Contents Previous Next


7 Reference : 7.5 ECPGPlus Statements : 7.5.13 DISCONNECT

7.5.13 DISCONNECT
Use the DISCONNECT statement to close the connection to the server. The syntax is:
EXEC SQL DISCONNECT [connection_name][CURRENT][DEFAULT][ALL];
connection_name is the connection name specified in the CONNECT statement used to establish the connection. If you do not specify a connection name, the current connection is closed.
Include the CURRENT keyword to specify that ECPGPlus should close the most-recently used connection.
Include the DEFAULT keyword to specify that ECPGPlus should close the connection named DEFAULT. If you do not specify a name when opening a connection, ECPGPlus assigns the name, DEFAULT, to the connection.
Include the ALL keyword to instruct ECPGPlus to close all active connections.
The following example creates a connection (named hr_connection) that connects to the hr database, and then disconnects from the connection:

7 Reference : 7.5 ECPGPlus Statements : 7.5.13 DISCONNECT

Table of Contents Previous Next