odbx_rows_affected - Returns the number of changed records
Contents
Description
Returns the number of rows that have been changed by the current statement whose result set was retrieved
by odbx_result(). Affected rows are only returned for DELETE, INSERT or UPDATE statements and their con‐
crete number depends on the database implementation. Instead returning the number of rows which are
matched by the WHERE clause, MySQL for example does only count the rows whose values have really been
changed.
The result parameter required by this function must be a valid result set returned by odbx_result() and
must not has been feed to odbx_result_finish() before.
Errors
This function will also return zero if the result parameter is invalid.
Name
odbx_rows_affected - Returns the number of changed records
Return Value
odbx_rows_affected() returns the number of changed rows on success and zero if the database server didn't
alter any rows. A value of zero can be returned if the statement doesn't match any rows. Some database
server like MySQL may return a lower number than expected because they doesn't modify records whose val‐
ues wouldn't change.
See Also
odbx_result(), odbx_result_finish()
8 January 2025 odbx_rows_affected(3)
Synopsis
#include <opendbx/api.h>
uint64_t odbx_rows_affected (odbx_result_t* result);
