sqlite - Android SQLiteDatabase delete function -
i have 1 strange situation sqlitedatabase.delete function
this don't delete null records:
sqlitedatabase.delete(table, "ifnull(field, 0) = ?", new string[]{"0"});
this delete null records without problems:
sqlitedatabase.execsql("delete table ifnull(field, 0) = 0");
can explain me, why in first case null records not deleted?
0
number, "0"
string. values of different types not equal.
the android database api not allow use type other string
parameters delete()
. if want put number sql statement, not use parameter insert directly.
Comments
Post a Comment