开发者

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.

开发者_如何学C

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)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜