[Fixed]-Django – Perform Raw SQL Update/Delete and return row count

32👍

An UPDATE statement as you’ve got in your example doesn’t return row results, so fetchone() will always be empty (or might throw an error).

Use cursor.rowcount to get the rows last affected.

Leave a comment