Nicholas Bastin <[EMAIL PROTECTED]>
wrote:
Is there any way to effectively prepare the following statement:
SELECT * FROM some_table WHERE id IN (?);
where the contents of the variable are a vector? (1,3,5,9,34,57), etc.
I've been building up these just using text and using exec, but it
seems you'd want to have a sqlite3_bind_int64_vector or something
similar....am I missing that this is implemented somewhere?
As far as I can tell, you can't directly do what you want. The closest
you can get to it is as follows: create a temporary table
create temp table list (id integer);
Insert your values into it:
insert into temp.list(id) values(?);
Finally, reorganize your select statement to use this table:
select * from some_table join temp.list on (some_table.id =
temp.list.id);
All statements used here can be prepared.
Igor Tandetnik