有没有一种简单的方法,以在Android的更新sqlite的表? (如在建方法一行)?我有几个列一个表,主要是一列。我想通过主键在表中进行搜索,然后更新一行。
Is there an easy way to update a table in sqlite in android? (like a single line in built method) ? I have a table with few columns and primary is one column. I want to search by the primary key and then update a row in the table.
您可以使用 rawQuery
是这样的:
cur = mDb.rawQuery("update " + TABLE_NAME
+ " set column1=mango where id='" + _id + "'",null);
其中
where
CUR
是 光标
的对象
TABLE_NAME
是 表的名称
的
_id
是 的列名
的(唯一的例子)