Prepared Statement with WHERE IN

Is there any way to do a Prepared Statement with a “WHERE IN” clause?

Should be the same as any other prepared statement

I guess this should work then. It just seems like overkill compared to what I used to do with a string and the join function.

[code]Dim i as Integer
Dim limit as Integer
Dim sql as String
Dim aIDs as Int64(-1)
Dim ps as SQLitePreparedStatement

limit = aIDs.Ubound

sql = “DELETE FROM Table1 WHERE id IN (”

For i=0 To limit
sql = sql + “?”

If i < limit Then
    sql = sql + “,”
    sql = sql + “)”
End if

ps.BindType(i, SQLitePreparedStatement.SQLITE_INT64)
ps.Bind(i, aIDs(i))


looks like it

I can think of an alternative
create a temp table
insert values into that with a simple prepared stmt
write a simpler query that is “DELETE FROM Table1 where id in ( select id from temp_table )”
drop the temp table

upside - you can put indexes on the temp table which you cant do with a long “in” clause
and sqlite’s optimizer MAY be able to run this quicker

Thanks Norman.