开发者

String[] whereArgs parameter of database method in android

开发者 https://www.devze.com 2023-02-01 12:54 出处:网络
delete(String t开发者_运维知识库able, String whereClause, String[] whereArgs) update(String table, ContentValues values, String whereClause, String[] whereArgs)
delete(String t开发者_运维知识库able, String whereClause, String[] whereArgs)

update(String table, ContentValues values, String whereClause, String[] whereArgs)

What is this String[] whereArgs? Is it connected with "?" (so called wild card)?


Yes, the String[] whereArgs contains the arguments to be appended to the whereClause.

For example, you want to make a delete query:

delete from InfoTable where name = "ABC" and id = "23"

then the query should be:

delete("InfoTable", "name = ? AND id = ?" , new String[] {"ABC", "23"});
0

精彩评论

暂无评论...
验证码 换一张
取 消