Getting the number of affected rows for a SQLite statement using the C API
I'm executing a DELETE
statement using the SQLite 3 C API, and I'd like to know how to fetch the number of affected rows.
Unfortunately, there is no function such as sqlite3_affected_rows
or similar.
Try sqlite3_changes() and/or sqlite3_total_changes()
Run this.
select changes(),total_changes();
The changes() function returns the number of database rows that were changed or inserted or deleted by the most recently completed INSERT, DELETE, or UPDATE statement
The total_changes() function returns the number of row changes caused by INSERT, UPDATE or DELETE statements since the current database connection was opened.
(emphasis added)
精彩评论