开发者

SQLite Beginner Question. Android Content resolver.update(...) insert(...)

开发者 https://www.devze.com 2023-03-16 21:07 出处:网络
Do I explicitly write WH开发者_高级运维ERE clause for insert/updates? Like so: cr.update(uri, values, \"WHERE _id=\"+id, null);Try

Do I explicitly write WH开发者_高级运维ERE clause for insert/updates?

Like so:

cr.update(uri, values, "WHERE _id="+id, null);


Try

String[] args = {String.valueOf(id)};
cr.update(uri, values, Data._ID + "=?", args);


ContentResolver.update()

About the where parameter:

A filter to apply to rows before updating, formatted as an SQL WHERE clause (excluding the WHERE itself).

0

精彩评论

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