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.
SQLite Limit: You can limit the number of rows returned by your SQL query, by using the LIMIT clause. For example, LIMIT 10 will give you only 10 rows and ignore all the other rows. In the LIMIT clause, you can select a specific number of rows starting from a specific position using the OFFSET clause.
sqlite > dbinfo. sql will give you detail info on each table's size on disk.
The sqlite3_step() runs the SQL statement. SQLITE_ROW return code indicates that there is another row ready. Our SQL statement returns only one row of data, therefore, we call this function only once. sqlite3_finalize(res); The sqlite3_finalize() function destroys the prepared statement object.
Try sqlite3_changes() and/or sqlite3_total_changes()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With