SQLExecute ODBC Function
SQLExecute executes a prepared statement, using the current values of the parameter marker variables if any parameter markers exist in the statement.
SQLRETURN SQLExecute(
SQLHSTMT StatementHandle);
StatementHandle
[Input] Statement handle.
Returns
SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_NEED_DATA, SQL_STILL_EXECUTING, SQL_ERROR, SQL_NO_DATA, or SQL_INVALID_HANDLE.
SQLExecute executes a statement prepared by SQLPrepare. After the application processes or discards the results from a call to SQLExecute, the application can call SQLExecute again with new parameter values.
To execute a SELECT statement more than once, the application must call SQLCloseCursor before reexecuting the SELECT statement.
If an application uses SQLPrepare to prepare and SQLExecute to submit a COMMIT or ROLLBACK statement, it will not be interoperable between DBMS products. To commit or roll back a transaction, call SQLEndTran.
If SQLExecute encounters a data-at-execution parameter, it returns SQL_NEED_DATA. The application sends the data using SQLParamData and SQLPutData.
If SQLExecute executes a searched update or delete statement that does not affect any rows at the data source, the call to SQLExecute returns SQL_NO_DATA.