jeudi 4 février 2016

Android sqllite. Can't delete row in table if String contains '+' character

I am trying to delete row in table:

DBHelper dbHelper = new DBHelper(ctx);
SQLiteDatabase db = dbHelper.getWritableDatabase();
String _number="+79261604030";
db.delete("calls", "number = " + _number, null);`

If I use just numbers, everything works fine, but if a string has a + sign, the row is not deleted. I think this is problem of special characters, but don't know how to change string.

Thanks.

Aucun commentaire:

Enregistrer un commentaire