DISCONNECT
The DISCONNECT statement closes the connection with the database.
General format
EXEC SQL [ AT Database ]
 
  DISCONNECT [ { Connection-Name } ]
               { CURRENT         } 
               { ALL             }
 
END-EXEC
Syntax rules
1. Connection-Name is a Nonnumeric Literal, as defined in the Definitions section of the Preface of this document.
2. Connection-Name can be referenced by the SET CONNECTION statement
General rules
1. CURRENT is default.
2. When the ALL phrase is specified, the application is disconnected from all connected databases.
3. Database identifies the active connection that will execute the query and must be previously defined using a Format 4 DECLARE statement.
Examples
Disconnect from the current connection
exec sql disconnect end-exec