Core function
Stop processing associated with a specific statement handle.
EDSFreeStmt(HSTMT_IV, OPTION_IV )
•HSTMT_IV An input integer value that indicates the statement handle.
•OPTION_IV An input integer value indicating one of the following:
EDS_CLOSE: Close the cursor associated with the statement handle (if one was defined) and discard all pending results. Your application can reopen this cursor later by executing a SELECT statement again later with the same or different parameter values. If no cursor is open, this option has no effect.
EDS_DROP: Release the statement handle, free all resources associated with it, close the cursor (if one is open), and discard all pending rows. This option terminates all access to the statement handle. The statement handle must be reallocated to be reused.
EDS_UNBIND: Release all column buffers bound by EDSBindCol for the
given statement handle.
EDS_RESET_PARAMS: Release all parameter buffers set by EDSSetParam
for the given statement handle.
Description
Your application can call EDSFreeStmt to terminate processing of a SELECT statement with or without cancelling the statement handle. EDSFreeStmt stops processing associated with a specific statement handle, closes any open cursors associated with the statement handle, discards pending results, and, optionally, frees all resources associated with the statement handle.
The EDS_DROP option frees all resources that were allocated by the EDSAllocStmt function.
Return Values
EDSFreeStmt returns EDS_SUCCESS, EDS_ERROR, or EDS_INVALID_HANDLE.
When EDSFreeStmt returns EDS_ERROR, you can obtain an associated SQLSTATE value with more specific information by calling EDSError. The following table lists each typical SQLSTATE value and explains each one in the context of the command EDSFreeStmt.
The following table lists possible SQLSTATE values:
SQL STATE |
Error |
Description |
IM001 |
Driver does not support this function |
The driver associated with the statement handle does not support the function. |
S1000 |
General error |
An error occurred for which there was no specific SQLSTATE and for which no implementation-specific SQLSTATE was defined. The error message returned by EDSError in the argument ERRORTEXT describes the error and its cause. |
S1001 |
Memory allocation failure |
The driver was unable to allocate the memory required to support execution or completion of the function. |
S1010 |
Function sequence error |
An asynchronously executing function (not this one) was called for the statement handle and was still executing when this function was called. |
S1092 |
Option type out of range |
The value specified for the argument OPTION_IV was not: EDS_CLOSE EDS_DROP EDS_UNBIND EDS_RESET_PARAMS |
See Also
EDSAllocStmt allocates a statement handle (the opposite of EDSFreeStmt).
EDSCancel cancels statement processing asynchronously and retains the statement handle.
EDSSetCursorName associates a name and statement with a cursor.