Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
4 views
in SQL by (20.3k points)

I need to implement SQLite in my application. I followed this tutorial... Creating and using databases in Android one

Everything is working fine. I inserted 1 row with 5 columns. Now I want to update the value of 1 column only and others will remain the same.

There is one update method in the tutorial but it needs all the parameters, however, I want to update only one column.

1 Answer

0 votes
by (40.7k points)

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

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Nov 20, 2019 in Java by Anvi (10.2k points)
0 votes
1 answer
0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...