The sqlexit() function

The sqlexit() function terminates all database server connections and frees resources. You can use sqlexit() to reduce database overhead in programs that refer to a database only briefly and after long intervals, or that access a database only during initialization.

Syntax

mint sqlexit();

Usage

Only call the sqlexit() function when no databases are open. If an open database uses transactions, sqlexit() rolls back any open transactions before it closes the database. The behavior of this function is similar to that of the DISCONNECT ALL statement. However, the DISCONNECT ALL statement fails if any current transactions exist. Use the CLOSE DATABASE statement to close open databases before you call sqlexit().

If the application has only one implicit connection before it calls sqlexit(), execution of the next SQL statement or of the sqlstart() library function reestablishes an implicit connection to the default database server. If the application makes one or more explicit connections, you must issue a CONNECT statement before you execute any other SQL statements.

Return codes

0
The call to sqlexit() was successful.
<0
The call to sqlexit() was not successful.