qdb_rowchanges()

Return the number of rows affected by a statement

Synopsis:

#include <qdb/qdb.h>

uint64_t qdb_rowchanges( qdb_hdt_t *hdl
                         qdb_result_t *result );

Arguments:

hdl
A pointer to the database handle. You can pass as NULL if you provide result, and QDB_OPTION_ROW_CHANGES option has been set by qdb_setoption() (it's on by default).
result
A pointer to a result set you want to query. If you pass NULL, the function queries the result from the last executed qdb_statement() on hdl.

Library:

qdb

Description:

This function returns the number of rows that were affected in a statement. It first looks in result (if the QDB_OPTION_ROW_CHANGES option has been set by qdb_setoption()), returning the number of rows for the statement that produced the result. If result is NULL, or QDB_OPTION_ROW_CHANGES is off, the function queries the database handle hdl and returns the information about the last executed statement.

If this function returns 0, check errno to make sure that it is EOK, indicating that no row was affected (you should set errno to 0 before calling this function if you want to distinguish between an error and 0 rows). If errno is not EOK then there was an error with the request.

Returns:

> 0
The number of rows affected
0
An error occurred (errno is set), or 0 rows were affected.

Classification:

QNX Neutrino

Safety:
Interrupt handler No
Signal handler No
Thread Yes

See also:

qdb_setoption(), qdb_statement()