Executes a COMMIT for the specified transaction object and then disconnects from the specified database.
DISCONNECT {USING TransactionObject};
Parameter |
Description |
---|---|
TransactionObject |
The name of the transaction object that identifies the database you want to disconnect from and in which you want to permanently update all database operations since the previous COMMIT, ROLLBACK, or CONNECT. This clause is required only for transaction objects other than the default (SQLCA). |
Error handling It is good practice to test the success/failure code after executing a DISCONNECT statement.
Example 1 This statement disconnects from the database specified in the default transaction object:
DISCONNECT ;
Example 2 This statement disconnects from the database specified in the transaction object named Emp_tran:
DISCONNECT USING Emp_tran ;