|
int sqlite3_total_changes(sqlite3*);
This function returns the number of database rows that have been modified by INSERT, UPDATE or DELETE statements since the database handle was opened. This includes UPDATE, INSERT and DELETE statements executed as part of trigger programs. All changes are counted as soon as the statement that makes them is completed (when the statement handle is passed to sqlite3_reset() or sqlite3_finalize()).
See also the sqlite3_change() interface.
SQLite implements the command "DELETE FROM table" without a WHERE clause by dropping and recreating the table. (This is much faster than going through and deleting individual elements form the table.) Because of this optimization, the change count for "DELETE FROM table" will be zero regardless of the number of elements that were originally in the table. To get an accurate count of the number of rows deleted, use "DELETE FROM table WHERE 1" instead.
If another thread makes changes on the same database connection while this routine is running then the return value of this routine is undefined.
See also lists of Objects, Constants, and Functions.