Good day.
Tell me how in Android SQLite delete all records from the table?
You can try this:
db.delete("TABLE_NAME", null, null); be careful with quotes.
Well, or so:
/** * Remove all users and groups from database. */ public void removeAll() { // db.delete(String tableName, String whereClause, String[] whereArgs); // If whereClause is null, it will delete all rows. SQLiteDatabase db = helper.getWritableDatabase(); // helper is object extends SQLiteOpenHelper db.delete(DatabaseHelper.TAB_USERS, null, null); db.delete(DatabaseHelper.TAB_USERS_GROUP, null, null); } Source: https://ru.stackoverflow.com/questions/592547/
All Articles
SQLiteOpenHelperclass has its own methods for inserting, updating, deleting, and selecting from SQLite databases , which are somewhat safer and more concise than raw queries. - pavlofff