I’m working on an android project and I have to delete all records in my table:
public void deleteAll(){
SQLiteDatabase db=this.getWritableDatabase();
String req="delete * from "+ TABLE_ENIGME;
db.execSQL(req);
}
But when I call my function deleteAll this exception is reveled :
android.database.sqlite.SQLiteException: near "*": syntax error: delete * from enigme2
So why ” * ” is innapropriate?
Please have a look at http://www.sqlite.org/lang_delete.html.
Delete does not accept wildcard.
Use
instead