android - Method db.delete some rows? -


I have 4 fields in the table (note 1, note 2, note 3, note 4). I want to delete all the data contained in note 1 and note 2 . I want to add logic to the method db.delete , but I have trouble.

  Public Zero Deletion () {SQLiteDatabase db = mHelper.getWritableDatabase (); Db.delete (Note: TABLE_NAME, blank, blank); }   

Delete always deletes entire rows.

In the specific column to clear the value, use an update query, for example

  ContentValues ​​cv = new ContentValues ​​(); cv.putNull ("Note1"); cv.putNull ("comment2"); Db.update (NoteABABLE.TABLE_NAME, CV, empty, empty);    

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -