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?