问题描述
我已经创建了我的Android开发平台内使用的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?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!