我想在不根据行数据的完整列中输入数据

时间:2019-09-04 15:31:19

标签: android-sqlite

我在android中使用sq lite数据库 我已经在两列中有数据了,我想在没有条件的情况下更改第2列中的数据 我在哪里搜索过使用条件的地方 这就是我的存储方式

Column

1 个答案:

答案 0 :(得分:0)

为第3d和第4个参数传递null

public boolean updateData(String pass) {
    SQLiteDatabase db = this.getWritableDatabase();
    ContentValues contentValues = new ContentValues();
    contentValues.put(col2, pass);
    db.update(TABLE_NAME, contentValues, null, null);
    db.close();
    return true;
}

我猜您不需要参数name,因为没有WHERE子句,所以我删除了它。