Joseph Garry <> wrote:
> I'd like to set up a compiled sqllite (sqlite3_prepare_v2) statement with a 
> query like
> 'select tabid, col1, col2 from table where tabid in (?)'
> But how do I bind in the parameter here? An example would be welcome, of 
> course.

You can't do that directly. One way is to create a temp table, like this:

create temp table TabIdList (tabid integer);

Now you can prepare this statement:

select tabid, col1, col2 from myTable where tabid in (select tabid from 

Populate TabIdList with your list of IDs (you can use a prepared statement for 
this, too, along the lines of "insert into TabIdList(tabid) values (?); ").
Igor Tandetnik

sqlite-users mailing list

Reply via email to