2012-02-21 4 views
4

나는 여러 매개 변수를 전달해야하는 업데이트 쿼리가 있습니다. 어떻게하는지 안내하십시오. 여기에 "id"대신 이름 나이와 같은 여러 매개 변수가 필요합니다.Android SQlite 업데이트 쿼리

// 코드

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

답변

16

`나는 당신이 잘못된 위치를 넣어 생각

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"}); 
+0

을 시도},' – ariefbayu

+0

@silent 편집 게시 할 수 있습니다. 고맙습니다. – user936414

관련 문제