SQLFreeHandle() invalidates and frees a handle.
SQLRETURN SQLFreeHandle (SQLSMALLINT htype, SQLINTEGER handle);
Data type | Argument | Use | Description |
---|---|---|---|
SQLINTEGER | handle | Input | The handle to be freed. |
SQLSMALLINT | hType | Input | Handle type that must be SQL_HANDLE_ENV, SQL_HANDLE_DBC, SQL_HANDLE_STMT, or SQL_HANDLE_DESC. |
SQLFreeHandle() combines the function of SQLFreeEnv(), SQLFreeConnect(), and SQLFreeStmt().
SQLSTATE | Description | Explanation |
---|---|---|
58004 | System error | Unrecoverable system error. |
HY001 | Memory allocation failure | The driver is unable to allocate memory required to support the processing or completion of the function. |
HY010 | Function sequence error | There is an hdbc which is in allocated or connected state. Call SQLDisconnect and SQLFreeConnect for the hdbc before calling SQLFreeHandle. |
HY013 * | Memory management problem | The driver is unable to access memory required to support the processing or completion of the function. |