Possible Duplicate:
SQLite rawQuery selectionArgs and Integers Fields
Here is my table schema
create table Account (accountId) // accountId is long in practice
I am not able to use the parameter version of delete to delete a row given an long id. getPk() below returns a long id.
getDb().delete("Account", "accountId = ?", new String[]{ account.getPk().toString()});
However, I can workaround this by passing the parameter in the where clause.
getDb().delete("Account", "accountId = " + account.getPk().toString(), null);
My guess is that the parameter version of delete will work for string parameter but not integer/long parameter. Any insight?
EDIT: Another strange thing is, if I changed the table schema to below, both versions of delete work fine.
create table Account (accountId integer primary key autoincrement)