---
name: "odbx_rows_affected"
section: "3"
platform: "linux"
package: "opendbx"
version: "1.4.6-13"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/odbx_rows_affected"
---

# odbx\_rows\_affected(3)

Returns the number of changed records

## NAME

odbx\_rows\_affected - Returns the number of changed records

## SYNOPSIS

```
FC#include <opendbx/api.h>F[0]
```

FCuint64\_t **odbx\_rows\_affected**F\[0\]  FC(odbx\_result\_t\* *result*);F\[0\]

## DESCRIPTION

Returns the number of rows that have been changed by the current statement whose result set was retrieved by FC**odbx\_result**F\[0\](). Affected rows are only returned for DELETE, INSERT or UPDATE statements and their concrete 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 FCresultF\[0\] parameter required by this function must be a valid result set returned by FC**odbx\_result**F\[0\]() and must not has been feed to FC**odbx\_result\_finish**F\[0\]() before.

## RETURN VALUE

FC**odbx\_rows\_affected**F\[0\]() 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 values wouldn't change.

## ERRORS

This function will also return zero if the FCresultF\[0\] parameter is invalid.

## SEE ALSO

FC**odbx\_result**F\[0\](), FC**odbx\_result\_finish**F\[0\]()
