获取SQLite FTS3表的行ID [英] Get row ID of an SQLite FTS3 table

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

问题描述

我创建了一个在Android开发平台中使用的SQLite FTS3表(target为2.2,minVersion为8).例如,我按如下方式创建表:

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

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

我知道,当我向该表中插入数据时,我返回long,这是插入的记录的行ID.如何从此表中获取行ID?如果我执行:

I know that when I insert data into this table, I long is returned, which is the row ID of the record inserted. How do I get the row ID from this table? If I perform:

select * from person

我得到Cursor.getColumnColumnIndex("rowid");-1.同样,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'. Any suggestikns on how to solve this problem?

推荐答案

尝试使用:

select rowid,* from person

Rowid是一个隐藏字段,不包含在"*"中.

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

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

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