Get row ID of an SQLite FTS3 table
Asked Answered
L

1

17

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?

Languet answered 9/4, 2011 at 9:33 Comment(0)
C
38

Try using:

select rowid,* from person

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

Coincide answered 10/4, 2011 at 2:3 Comment(1)
This issue has been driving me crazy for 2 hours. ThanksGolanka

© 2022 - 2024 — McMap. All rights reserved.