开发者

Normal SELECT on an SQLite FTS Table

开发者 https://www.devze.com 2023-04-04 16:11 出处:网络
I\'m having an issue performing normal SELECT statements (that is, not the \'searches\' they were designed to do- I\'m not using MATCH).What I\'m trying to do is query the table for all rows of an INT

I'm having an issue performing normal SELECT statements (that is, not the 'searches' they were designed to do- I'm not using MATCH). What I'm trying to do is query the table for all rows of an INTEGER column. However, the SELECT statement always returns no rows. I've inspected the database with an SQLite browser and the query should work. Here it is:

Here's the MAKE TABLE statement:

CREATE VIRTUAL TABLE FTS_journal USING fts3(journal_id INTEGER, journal_text_col TEXT)

And here's the SELECT:

SELECT journal_id FROM FTS_journal

Does it have something to do with my running开发者_如何学Python a 'normal' query over a virtual table? I can't really think of any other reason

EDIT: I'm using Android's version of SQLite, meaning SQLite3. I know it supports FTS properly...

If any further information I can provide will help, please tell me and I will post it.


What you've written should work. Are you 100% positive you've actually inserted something into the table? Have you ran insert statements, and if so, are you sure they were successful?

I tested your statements, running the create statement, then the following statement:

insert into FTS_journal (journal_id, journal_text_col) values (1, 'test');

... then your select statement, and sqlite returned 1 row (journal_id, value 1) just as it should.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号