Search code examples
javaandroidandroid-sqlite

SQLite delete row using rowid not working


I created a sql query to delete a row given the rowid. When I run the query there are no errors, however, the row doesn't get deleted.

String query = "DELETE FROM " + TABLE_NAME + " WHERE " + " rowid " + " = " + id;
db.execSQL(query);

Solution

  • SOLUTION: I used the vacuum function to regenerate the proper rowId. I was previously deleting rows where that rowId didn't exist.