Using String[] selectionArgs in SQLiteDatabase.query()

怎甘沉沦 提交于 2019-11-28 05:13:23

selectionArgs replace any question marks in the selection string.

for example:

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

Yes, you may set all parameters to null except the table name.

for example:

Cursor cursor = db.query("TABLE_NAME", null, null, null, null, null, null);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!