Get row ID of an SQLite FTS3 table

烂漫一生 提交于 2019-11-29 06:20:21

问题


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);

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

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?


回答1:


Try using:

select rowid,* from person

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



来源:https://stackoverflow.com/questions/5604165/get-row-id-of-an-sqlite-fts3-table

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