SQlite update request for Android

I have an update request where I need to pass a few parameters. Please guide how to do this. Here, instead of "id", I want several parameters, for example, the age of the names.

//The code

ContentValues updateCountry = new ContentValues(); updateCountry.put("country_name", "United States"); db.update("tbl_countries", updateCountry, "id=?", new String[] {Long.toString(countryId)}) 
+4
source share
1 answer

Try

  ContentValues updateCountry = new ContentValues(); updateCountry.put("country_name", "United States"); db.update("tbl_countries", updateCountry, "id=? AND name=? AND age=?", new String[]{Long.toString(countryId),"name_value","age_value"}); 
+16
source

Source: https://habr.com/ru/post/1397555/


All Articles