开发者

Cursor of SQLite Query call that does not find anything matching the query criteria

What would a query call return if the query criteria isn't found in the table. Will the cursor returned be null? This is done in android.

Exampl开发者_如何学Ce:

Cursor c = rawQuery("SELECT c_name, FROM my_table, WHERE c_name = ?", "johnny");

What if there is no johnny in the column c_name? Will the cursor value be null?


A valid cursor will be returned, but it will contain no results. So checks like

if (c.moveToFirst())

will return false.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜