Version: 7.0.0

SQLFreeStmt ​

Function ​

Frees a statement handle. It can be replaced by SQLFreeHandle.

Prototype ​

c
SQLRETURN SQLFreeStmt(SQLHSTMT      StatementHandle,
                      SQLUSMALLINT  Option);

Parameters ​

Table 1 SQLFreeStmt parameters

Keyword

Parameter Description

StatementHandle

Statement handle to be freed.

Option

Type of the operation to be performed.

Return Values ​

  • SQL_SUCCESS: The call is successful.

  • SQL_SUCCESS_WITH_INFO: Some warning information is present.

  • SQL_ERROR: Execution failed, and the statement handle was not freed.

  • SQL_INVALID_HANDLE: The input statement handle is invalid.

NOTE ​

If SQLFreeStmt returns SQL_ERROR, the statement handle remains valid. To make the code more robust and easier to maintain, it is recommended to use the standard interface SQLFreeHandle instead of SQLFreeStmt.

Example ​

See: Example