0

When I delete a row the ids do not change and they still count like i did not delete one, for example if I have a table from 1 to 10 and I delete '6' it still goes from 1 to 10 with '1,2,3,4,5,7,8,9,10' - How can I fix this?

public void deleteTitle(String hour,String munites ,int position )
        {
            int value=position+1;
            SQLiteDatabase db = this.getWritableDatabase();
            db.delete(TABLE_NAME, COL2 + " = ? AND " + COL3 + " = ?", new String[] {hour, munites +""});        

            db.execSQL("DELETE FROM SQLITE_SEQUENCE WHERE NAME = '" + TABLE_NAME + "'");

        }
A.Turner
  • 196
  • 1
  • 13
moha
  • 7
  • 5
  • 1
    I think `reseed` is what you need. Check out [this thread](https://stackoverflow.com/questions/21824478/reset-identity-seed-after-deleting-records-in-sql-server). – Rigerta Aug 21 '17 at 13:55
  • how can i use it in android can u modifie the code plz? – moha Aug 21 '17 at 13:56

0 Answers0