Difference between revisions of "OpenDBX/C API/odbx rows affected"

From Linuxnetworks
< OpenDBX‎ | C API
Jump to: navigation, search
(header)
(enhanced article)
Line 6: Line 6:
 
     odbx_result_t* '''result''' )
 
     odbx_result_t* '''result''' )
  
= Description: =
+
= Description =
  
Returns the number of rows changed by the last non SELECT-like query. Zero is returned if no rows have been changed, either due to the statement or due to an error.
+
Returns the number of rows that have been changed by the current statement whose result was retrieved by [[OpenDBX result|odbx_result()]]. Affected rows are only returned for DELETE, INSERT or UPDATE statements and their number depends on the database implementation. Instead returning the number of rows which are matched by the WHERE clause, MySQL does only count the rows whose values have really been changed.
  
= Parameters: =
+
The '''result''' parameter required by this function must be a valid result set returned by [[OpenDBX result|odbx_result()]] and must not have been feed to [[OpenDBX result_free|odbx_result_free()]] before.
  
* result: Object created by [[OpenDBX_result|odbx_result()]]
+
= Return values =
  
= Return values: =
+
'''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 due to the conditions in the WHERE clause of the statement which doesn't match any rows or due to an error like an invalid '''result''' parameter.
  
* Number of rows affected by the last statement
+
= Errors =
  
= Errors: =
+
This function doesn't return any error conditions.
  
* None
+
= See also =
  
= See also: =
+
* [[OpenDBX result|odbx_result()]]
 +
* [[OpenDBX result_free|odbx_result_free()]]
  
  
 
----
 
----
 
Back to [[OpenDBX API|Overview]]
 
Back to [[OpenDBX API|Overview]]

Revision as of 21:29, 23 April 2007


#include <odbx.h>

uint64_t odbx_rows_affected(
    odbx_result_t* result )

Description

Returns the number of rows that have been changed by the current statement whose result was retrieved by odbx_result(). Affected rows are only returned for DELETE, INSERT or UPDATE statements and their number depends on the database implementation. Instead returning the number of rows which are matched by the WHERE clause, MySQL 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 have been feed to odbx_result_free() before.

Return values

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 due to the conditions in the WHERE clause of the statement which doesn't match any rows or due to an error like an invalid result parameter.

Errors

This function doesn't return any error conditions.

See also



Back to Overview