SQLCloseCursor() closes the open cursor on a statement handle.
SQLRETURN SQLCloseCursor (SQLHSTMT hstmt);
Data type | Argument | Use | Description |
---|---|---|---|
SQLHSTMT | hstmt | Input | Statement handle |
Calling SQLCloseCursor() closes any cursor associated with the statement handle and discards any pending results. If no open cursor is associated with the statement handle, the function has no effect.
If the statement handle references a stored procedure that has multiple result sets, the SQLCloseCursor() closes only the current result set. Any additional result sets remain open and usable.
SQLSTATE | Description | Explanation |
---|---|---|
08003 * | Connection not open | The connection for hstmt is not established. |
HY009 * | Argument value that is not valid | hstmt is not a statement handle. |
HY021 | Internal descriptor that is not valid | The internal descriptor cannot be addressed or allocated, or it contains a value that is not valid. |