"He Shiming" <heshim...@gmail.com> wrote
in message
news:c4118a5d0902130623g48e19a64pa4fea079ea7dc...@mail.gmail.com
> I'm working on this project. It puts a lot of files into a single
> sqlite database (including the actual file content, the program is
> designed to store the actual content) for search. When a search
> command is issued, I run a SELECT command on the FILE_INFO table to
> get stuff like file name, size and date. Then I run a background
> thread to obtain the actual file content from FILE_CONTENT table. The
> syntax of the query to obtain the file content is quite silly. Since
> I have all the row IDs in the first query, I ran a query like this:
> SELECT bin_content FROM FILE_CONTENT WHERE id in (1,2,3,4...);
>
> The query is built by sprintf with a for loop, obviously.

Consider replacing this query with a programmatic loop using blob API:

http://sqlite.org/c3ref/blob_open.html

or simply running a query like this:

SELECT bin_content FROM FILE_CONTENT WHERE id = ?;

with a new Id on every loop iteration.

Igor Tandetnik



_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to