affected row count
The number of rows an INSERT, UPDATE or DELETE actually changed, reported back to the program that ran it.
In more detail
Checking it turns a silent failure into a signal: zero rows from a conditional update means someone else changed the row first, or it no longer exists. SQLite reports it through the changes() function.
Related terms
- UPDATE — The SQL statement that changes values in existing rows, choosing the rows with WHERE and the new values with SET.
- compare and set — An update that changes a row only if it still holds the value the program expects, and reports whether it did.
- lost update — A concurrency bug where two sessions read the same value, both write a result based on it, and the later write silently erases the earlier one.
Taught in
- Updating And Deleting Safely — PostgreSQL, Indexing & Relational Data Modeling
- Isolation Levels And The Lost Update — PostgreSQL, Indexing & Relational Data Modeling