Reputation: 29533
I am trying to delete a row from a table but i have three WHERE clauses and i am not sure if i am using the correct statement.
db.delete(DBAdapter.TableName, "Id="+ Id
+" AND WHERE QstnrId = "+Integer.parseInt(QuestionnaireId)
+" AND WHERE QstnId = "+Integer.parseInt(QuestionId), null);
I am almost certain i am not using the statement correctly. Please assist?
Upvotes: 10
Views: 15690
Reputation: 185852
You don't need to use the WHERE
keyword. Also you could try using the third parameter to delete()
:
db.delete(DBAdapter.TableName, "Id=? AND QstnrId=? AND QstnId=?",
new String[] { Id.toString(), QuestionnaireId, QuestionId });
Upvotes: 23