【发布时间】:2020-08-28 03:52:19
【问题描述】:
我的应用程序包含 sqlite db,我的问题:如果特定列已更改或更新,是否有方法或方法可以保存和查看特定列的历史记录?我的应用程序基本上是用于项目的输入和输出。一切正常,但我想跟踪项目数量的历史,我无法弄清楚输出项目的代码:
boolean updateexistItemOutput(String itemname, String itemtype ,String itemsTypeOut, double outputQty, double total, double profit, double profitMultiple, double totalProfitSingle,
double totalProfitMultiple, String lastUpdated, String inOrOut, String notes) {
SQLiteDatabase sqLiteDatabase = getWritableDatabase();
ContentValues contentValues = new ContentValues();
contentValues.put(column_name, itemname);
contentValues.put(column_outputquantity, outputQty);
contentValues.put(column_itemsType,itemtype);
contentValues.put(column_total, total);
contentValues.put(column_profitSingle, profit);
contentValues.put(column_profitMultiple, profitMultiple);
contentValues.put(column_TotalprofitSingle, totalProfitSingle);
contentValues.put(column_TotalprofitMultiple, totalProfitMultiple);
contentValues.put(column_updateDate, lastUpdated);
contentValues.put(column_inOurOut, inOrOut);
contentValues.put(column_notes,notes);
contentValues.put(column_itemsTypeOut, itemsTypeOut);
return sqLiteDatabase.update(table_Name, contentValues, column_name + "=?", new String[]{itemname}) > 0;
}
【问题讨论】:
标签: java android database sqlite