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

From Linuxnetworks
< OpenDBX‎ | C API
Jump to: navigation, search
 
(17 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
 +
'''Returns the number of changed records'''
  
  uint64_t odbx_rows_affected(
+
  #include <opendbx/api.h>
    odbx_result_t* result )
+
  
= Description: =
+
uint64_t '''odbx_rows_affected'''(
 +
    odbx_result_t* '''''result''''' )
  
Returns the number of rows changed by the last non SELECT-like query. Zero is returned if nothing was changed, either due to the statement or due to an error.
+
== Description ==
  
= Parameters: =
+
Returns the number of rows that have been changed by the current statement whose result set was retrieved by [[OpenDBX/API/odbx_result|odbx_result]](). 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.
  
* result: Object created by odbx_result()
+
The '''''result''''' parameter required by this function must be a valid result set returned by [[OpenDBX/API/odbx_result|odbx_result]]() and must not has been feed to [[OpenDBX/API/odbx_result_finish|odbx_result_finish]]() before.
  
= Return values: =
+
== Return value ==
  
* Number of rows affected by the last query
+
[[OpenDBX/API/odbx_rows_affected|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 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: =
+
== Errors ==
  
* None
+
This function will also return zero if the '''''result''''' parameter is invalid.
  
 +
== See also ==
  
----
+
* [[OpenDBX/API/odbx_result|odbx_result]]()
Back to [[OpenDBX API|Overview]]
+
* [[OpenDBX/API/odbx_result_finish|odbx_result_finish]]()
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
 
+
<div  style="display:none">
+
[We are delicate. We do not delete your content.]
+
[l_sp91]
+
[http://sitepalace.com/indoortanningbeds/ indoor tanning beds]
+
[http://sitepalace.com/cleo/daybedcomfortersets/ daybed comforter sets]
+
[http://sitepalace.com/cleo/southwesternbedding/ southwestern bedding]
+
[http://sitepalace.com/cleo/leathersectionalsofa/ leather sectional sofa]
+
[http://home.graffiti.net/thomasville_bedding/ thomasville bedding]
+
[http://home.graffiti.net/naturalizer_shoes/ naturalizer shoes]
+
[http://home.graffiti.net/designer_dog_beds/ designer dog beds]
+
[http://mujweb.cz/www/k1visa/ k1 visa]
+
[http://mujweb.cz/www/k1visa/fiancee-visa/ fiancee visa]
+
[http://rivotril.google.if.ua rivotril]
+
[http://republika.pl/cleo06/cingular-ringtone.htm cingular ringtone]
+
[http://republika.pl/cleo06/nail-fungus.htm nail fungus]
+
[http://republika.pl/cleo06/bridesmaid-dress.htm bridesmaid dress]
+
[http://republika.pl/cleo06/formal-prom-dresses.htm formal prom dresses]
+
[http://republika.pl/cleo06/bcbg-shoes.htm bcbg shoes]
+
[http://mysite.com.ua/xdem8200/pagesxdem8200/1_1.html tramadol hcl]
+
[http://mywebpage.netscape.com/burochka/cingular-ringtone.htm cingular ringtone]
+
[http://mywebpage.netscape.com/burochka/bcbg-shoes.htm bcbg shoes]
+
[http://mywebpage.netscape.com/burochka/bridesmaid-dress.htm bridesmaid dress]
+
[http://mywebpage.netscape.com/burochka/formal-prom-dresses.htm formal prom dresses]
+
[http://mywebpage.netscape.com/burochka/nail-fungus.htm nail fungus]
+
[http://www.buddyprofile.com/viewprofile.php?username=tanningbed tanning bed]
+
[http://www.buddyprofile.com/viewprofile.php?username=bcbgshoes bcbg shoes]
+
[http://www.buddyprofile.com/viewprofile.php?username=naturalizershoes naturalizer shoes]
+
[http://www.buddyprofile.com/viewprofile.php?username=leathersectionalsofa leather sectional sofa]
+
[http://www.buddyprofile.com/viewprofile.php?username=designerdogbeds designer dog beds]
+
[http://www.buddyprofile.com/viewprofile.php?username=heatedmattresspad heated mattress pad]
+
[http://www.buddyprofile.com/viewprofile.php?username=bridesmaiddress bridesmaid dress]
+
[http://www.buddyprofile.com/viewprofile.php?username=2006promdresses 2006 prom dresses]
+
[http://www.buddyprofile.com/viewprofile.php?username=formalpromdresses formal prom dresses]
+
[http://www.buddyprofile.com/viewprofile.php?username=sexypromdresses sexy prom dresses]
+
[http://www.buddyprofile.com/viewprofile.php?username=cheappromdresses cheap prom dresses]
+
[http://www.buddyprofile.com/viewprofile.php?username=nextelringtone nextel ringtone]
+
[http://www.buddyprofile.com/viewprofile.php?username=verizonringtones verizon ringtone]
+
[http://www.buddyprofile.com/viewprofile.php?username=cingularringtone cingular ringtone]
+
[http://www.buddyprofile.com/viewprofile.php?username=freesprintringtone free sprint ringtone]
+
[http://www.buddyprofile.com/viewprofile.php?username=freenextelringtone free nextel ringtone]
+
[http://dianabol.google.if.ua dianabol]
+
[http://tribulus-terrestris.blogs.eurosport.com tribulus terrestris]
+
[http://nutrex-lipo-6.blogs.eurosport.com nutrex lipo 6]
+
[http://tribex.blogs.eurosport.com Tribex]
+
[http://xyience.blogs.eurosport.com Xyience]
+
[http://vasopro.blogs.eurosport.com Vasopro]
+
[http://caffeine.blogs.eurosport.com caffeine pills]
+
[http://scifit.blogs.eurosport.com scifit]
+
[http://twinlab.blogs.eurosport.com twinlab]
+
[http://imean.com/blog/faxlesspaydayloans/ faxless payday loans]
+
 
+
</div>
+

Latest revision as of 23:14, 28 April 2009

Returns the number of changed records

#include <opendbx/api.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 set was retrieved by odbx_result(). 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 result parameter required by this function must be a valid result set returned by odbx_result() and must not has been feed to odbx_result_finish() before.

Return value

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 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 result parameter is invalid.

See also