affected rows from PreparedStatement_execute?
Jan-Henrik, Is the a way to obtain the number of affected rows after executing a prepared statement, like there is for Connection_execute? -- ________________________________________________________________ Paul J Stevens pjstevns @ gmail, twitter, skype, linkedin * Premium Hosting Services and Web Application Consultancy * www.nfg.nl/info@nfg.nl/+31.85.877.99.97 ________________________________________________________________
On Aug 2, 2013, at 12:50 PM, Paul J Stevens <paul@nfg.nl> wrote:
Is the a way to obtain the number of affected rows after executing a prepared statement, like there is for Connection_execute?
The following actually works for SQLite ... PreparedStatement_execute(pre); printf("Affected rows: %lld\n", Connection_rowsChanged(con)); But not for Postgres nor MySQL (or Oracle I guess). A PreparedStatement object uses a separate statement from its parent connection. That it works for SQLite is probably due to some coincidental implementation details not to be relied upon. However, adding and implementing PreparedStatement_rowsChanged in libzdb is trivial for MySQL, SQLite and Postgres and I assume also for Oracle (Volodymyr can probably answer that). Since you ask I guess this is something you need? If we are going to change the PreparedStatement.h API are there other functionality you have missed in this interface?
On 02-08-13 19:57, Jan-Henrik Haukeland wrote:
However, adding and implementing PreparedStatement_rowsChanged in libzdb is trivial for MySQL, SQLite and Postgres and I assume also for Oracle (Volodymyr can probably answer that). Since you ask I guess this is something you need?
Well, 'need' is too much, 'nice-to-have' would cover it more. So don't sweat over it. Turns out I can work around it for now. I just wondered if there was a specific reason not to add it. thanks. -- ________________________________________________________________ Paul J Stevens pjstevns @ gmail, twitter, skype, linkedin * Premium Hosting Services and Web Application Consultancy * www.nfg.nl/info@nfg.nl/+31.85.877.99.97 ________________________________________________________________
On Aug 3, 2013, at 11:24 AM, Paul J Stevens <paul@nfg.nl> wrote:
On 02-08-13 19:57, Jan-Henrik Haukeland wrote:
However, adding and implementing PreparedStatement_rowsChanged in libzdb is trivial for MySQL, SQLite and Postgres and I assume also for Oracle (Volodymyr can probably answer that). Since you ask I guess this is something you need?
Well, 'need' is too much, 'nice-to-have' would cover it more. So don't sweat over it. Turns out I can work around it for now.
Added, but need help from Volodymyr to test on Oracle. Otherwise it works for SQLite, MySQL and Postgres. http://code.google.com/p/libzdb/source/detail?r=559
participants (2)
-
Jan-Henrik Haukeland -
Paul J Stevens