如何获得一个SQLite FTS3表中的行ID? [英] How to get row ID of a SQLite FTS3 table?

查看:362
本文介绍了如何获得一个SQLite FTS3表中的行ID?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了我的Andr​​oid开发平台内​​使用的SQLite FTS3表(目标2.2和minVersion 8)。例如,我如下创建的表:

I have created a SQLite FTS3 table that I am using within the Android development platform (target 2.2 and minVersion 8). For example, I created the table as follows:

create virtual table person using fts3(first,last);

我知道,当我插入这个表,我弄了半天回来,这是插入记录的行ID。

I know that when I insert into this table, I get a long back, which is the row ID of the record inserted.

然而,当我从该表中读取,我怎么行ID?当我执行

However, when I read from this table, how do I get the row ID? When I perform

select * from person

我得到-1 Cursor.getColumnColumnIndex(ROWID); 此外, Cursor.getColumnNames()只显示两列('第一'和'最后'),而不是ROWID。

I get -1 for Cursor.getColumnColumnIndex("rowid"); also, Cursor.getColumnNames() only shows the two columns ('first' and 'last') and not the 'rowid'.

推荐答案

请尝试使用:

select rowid,* from person

ROWID是一个隐藏字段和不包括在*

Rowid is a hidden field and is not included in "*".

这篇关于如何获得一个SQLite FTS3表中的行ID?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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