SQLite: How many rows were affected by an UPDATE or DELETE?
Info by SmartUser | 2013-11-08 at 00:37
Question: We have performed an UPDATE or a DELETE request in our SQLite database. Now we are interested in how many rows from our table have been infected by this. For example, to check whether there were made any changes at all.
Solution: The function changes() helps us in this case. It gives us the number of rows that were affected by the last INSERT, DELETE or UPDATE statement. A call might look like this:
SELECT changes() FROM tab
If you have performed an INSERT, DELETE or UPDATE on the table "tab" before calling this command, the expression gives us the number of rows affected.
If we are interested in the total number of affected rows since connecting to the database, we can use the function total_changes() instead of changes() for this.
About the Author
The author has not added a profile short description yet.
Show Profile
Related Topics
MySQL: How many records have been found or are affected by my query?
Info | 0 Comments
SQLite: What is the ID of the last inserted row?
Info | 0 Comments
SQLite: Check or search for empty values
Question | 1 Answer
Firebird: INSERT with ON DUPLICATE KEY UPDATE
Question | 1 Answer
SQLite: CURRENT_TIMESTAMP returns wrong Time / Hour
Question | 1 Answer
SQLite: Reset AUTOINCREMENT
Question | 1 Answer
SQLite: Search for unequal Value
Question | 1 Answer
Important Note
Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.
Participate
Ask your own question or write your own article on askingbox.com. That’s how it’s done.