如何使用的String [] selectionArgs两个在SQLiteDatabase.query() [英] How to use String[] selectionArgs in SQLiteDatabase.query()

查看:293
本文介绍了如何使用的String [] selectionArgs两个在SQLiteDatabase.query()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何使用 selectionArgs两个 字符串查询()?我希望我可以将其设置为,因为我没有使用它。我只是试图从数据库加载整个无序,未分组表成光标

How do I use the selectionArgs String in query()? I wish I could just set it to null, as I have no use for it. I am just trying to load an entire unsorted, ungrouped table from a database into a Cursor.

推荐答案

selectionArgs两个取代任何问号在选择字符串。

selectionArgs replace any question marks in the selection string.

例如:

String[] args = { "first string", "second@string.com" };
Cursor cursor = db.query("TABLE_NAME", null, "name=? AND email=?", args, null);

至于你的问题 - 你可以使用空

as for your question - you can use null

这篇关于如何使用的String [] selectionArgs两个在SQLiteDatabase.query()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆