The following SQL query does not remove identifiers starting from zero.
Android Sqlite Table Structure
String CREATE_TABLE_BUS = "CREATE TABLE " + TABLE_BUS + "(" + KEY_TID + " INTEGER PRIMARY KEY AUTOINCREMENT," + KEY_BUS_NUM + " TEXT," + KEY_BUS_NAME + " TEXT," + KEY_FROM + " TEXT," + KEY_TO + " TEXT," + KEY_TYPE + " TEXT" + ")"; db.execSQL(CREATE_TABLE_BUS);
I saved BUS_NUM as text, and not as int for any purpose.
And this is the function that I call to delete the line.
public void Delete_Bus(String bus_num) { SQLiteDatabase db = this.getWritableDatabase(); db.delete(TABLE_BUS, KEY_BUS_NUM+"="+bus_num , null); Log.e("deleting bus num", bus_num); db.close();
This code works very well when the code does not start from scratch.
It works for 76555, not 09877. What is wrong with my code.
source share