qdb_rowchanges()

Return the number of rows affected by an SQL statement

Synopsis:

#include <qdb/qdb.h>

uint64_t qdb_rowchanges( qdb_hdt_t *db
                         qdb_result_t *result );

Arguments:

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

Library:

qdb

Description:

This function returns the number of rows affected by an SQL 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 not set, the function queries the database handle db 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, 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