0

Why this code:

String[] ids = {"5", "1", "3"};
db.delete(ACCOUNTS_TABLE, KEY_ROWID, ids);

return this exception?

android.database.sqlite.SQLiteBindOrColumnIndexOutOfRangeException: bind or column index out of range: handle 0x2069a88

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Vaek
  • 81
  • 1
  • 1
  • 10

2 Answers2

2

try this:

dbHelper.delete(ACCOUNT_TABLE, KEY_ROWID + "=?", ids);
mihail
  • 2,173
  • 19
  • 31
0

try to delete single row.

String[] ids = {"5", "1", "3"};
for(int i=0; i<ids.length; i++)
{
    db.delete(ACCOUNTS_TABLE, ids[i], null);
}

Hope this Helps.

Bhavin
  • 6,020
  • 4
  • 24
  • 26