Reputation: 13369
I need to write a query to delete specific columns of a particular row from SQLite in Android. I want to use it in the form of "db.delete (String table, String whereClause, String[] whereArgs)".
My application contains 4 columns for each row. I need to delete only 2 columns of a particular row. How can I do this?
Upvotes: 0
Views: 442
Reputation: 9629
You can't delete only columns of particular row. You have to delete either two columns for all rows or you have to set some definite value like null or 0 for that.
Upvotes: 1
Reputation: 13051
db.delete is a convenience method for deleting rows in the database. This will delete the entire row not just a few columns in the row.
You cannot delete a particular column for a specific row. You can only delete column for the entire table.
So you may consider setting the column values of the particular with some default value like NULL or 0.
Upvotes: 1