2017-01-19 12 views
0

更新メソッドのcontentvaluesには、変更するフィールドまたはすべてのフィールドの値のみを格納する必要がありますか?SQLiteの更新アイテムの値

ContentValues contentValues = new ContentValues(); 
    contentValues.put("field1", new_value); 
    db.update(table, contentValues, "serial code="+serial_code,null); 

または

ContentValues contentValues = new ContentValues(); 
    contentValues.put("field1", new_value); 
    contentValues.put("field2", value2); 
    contentValues.put("field3", value3); 
    ... 
    contentValues.put("lastfield", value99); 
    db.update(table, contentValues, "serial code="+serial_code,null); 

答えて

0

はい、あなたはSQLiteのコンテンツ値の任意のテーブルのすべての列の値を渡す必要を更新しないようにしたい列のみ値を追加することができます。

0

変更された列の値を渡すだけで、詳細を見つけるhere

関連する問題