1odbx_rows_affected(3)               OpenDBX              odbx_rows_affected(3)
2
3
4

NAME

6       odbx_rows_affected - Returns the number of changed records
7

SYNOPSIS

9       #include <opendbx/api.h>
10
11
12       uint64_t odbx_rows_affected (odbx_result_t* result);
13

DESCRIPTION

15       Returns the number of rows that have been changed by the current state‐
16       ment whose result set was retrieved by odbx_result(). Affected rows are
17       only  returned  for  DELETE, INSERT or UPDATE statements and their con‐
18       crete number depends on the database implementation. Instead  returning
19       the number of rows which are matched by the WHERE clause, MySQL for ex‐
20       ample does only count the rows whose values have really been changed.
21
22       The result parameter required by this function must be a  valid  result
23       set  returned  by  odbx_result() and must not has been feed to odbx_re‐
24       sult_finish() before.
25

RETURN VALUE

27       odbx_rows_affected() returns the number of changed rows on success  and
28       zero  if the database server didn't alter any rows. A value of zero can
29       be returned if the statement doesn't  match  any  rows.  Some  database
30       server  like MySQL may return a lower number than expected because they
31       doesn't modify records whose values wouldn't change.
32

ERRORS

34       This function will also return zero if the result parameter is invalid.
35

SEE ALSO

37       odbx_result(), odbx_result_finish()
38
39
40
41                                2 February 2021          odbx_rows_affected(3)
Impressum