This doesn't work, or to be precise doesn't tell me the true no. of affected rows:
The server is 5.0.22 and the problem arises using either MySQL++ 2.1 or 2.2. The statement
is a 'multi query' but consists of either use, create, insert, update or delete commands -
no selects.
Because of the multi query I have to use this kind of loop:
Query query = m_db->query ();
query << "use db_name;delete from table_name where..."
for (Result result = query.store () ; query.more_results () ; result = query.store_next
())
if (query.success ())
results += m_db->affected_rows (); // Always 0!
Even though I really want to use execute() so I can check the returned ResNSel object - I
can't because these are multi-statements.
Shouldn't affected rows be working here? As I said - it (affected_rows) doesn't appear to
work when anything is prepended by a use db_statement. Neither does calling the num_rows
method of Result.
Anyone else had this? Or does anyone else have any recommendations - I've tried a myriad
of things now whilst checking the reference manual and user guide.
Jim Vanns
--
James Vanns
Systems Programmer
Framestore CFC Ltd.
--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsub=1
--
James Vanns
Systems Programmer
Framestore CFC Ltd.