Android的SQLite的:更新语句 [英] Android SQLite: Update Statement
本文介绍了Android的SQLite的:更新语句的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要在我的应用程序中实现的SQLite。我跟着这个教程.. <一href="http://www.android10.org/index.php/articlesdatastorage/235-creating-and-using-databases-in-android-one">Creating而在Android的之一使用的数据库
I need to implement SQLite in my application. I followed this tutorial.. Creating and using databases in Android one
一切工作正常。我插入1行5列。 现在我想更新1列的值只能和其他人将保持不变。
Everything is working fine. I inserted 1 row with 5 columns. Now I want to update value of 1 column only and others will be remain same.
有一个在教程中一个更新的方法,但它需要的所有参数,但我想更新一列。
There is one update method in tutorial but it needs all the parameters, however I want to update only one column.
推荐答案
您可以使用下面的code。
You can use the code below.
String strFilter = "_id=" + Id;
ContentValues args = new ContentValues();
args.put(KEY_TITLE, title);
myDB.update("titles", args, strFilter, null);
这篇关于Android的SQLite的:更新语句的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文