Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/393.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/209.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java SQLite更新项目值_Java_Android_Sqlite - Fatal编程技术网

Java SQLite更新项目值

Java SQLite更新项目值,java,android,sqlite,Java,Android,Sqlite,在更新方法中,contentvalues必须仅存储我要更改的字段的值,还是存储每个字段的值 ContentValues contentValues = new ContentValues(); contentValues.put("field1", new_value); db.update(table, contentValues, "serial code="+serial_code,null); 或 是的,您可以只添加要更新的列值,而无需为SQLite内容值中任何表的所有

在更新方法中,contentvalues必须仅存储我要更改的字段的值,还是存储每个字段的值

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


是的,您可以只添加要更新的列值,而无需为SQLite内容值中任何表的所有列传递值

是的,您可以只添加要更新的列值,而无需为SQLite内容值中任何表的所有列传递值

只需传递已更改的列值,查找更多详细信息

只需传递已更改的列值,查找更多详细信息

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);