There is the executemany and some other methods I have found for inserting data. However execute many doesn't work for SELECT.
In the sql format, the IN and VALUES can be used, for example:
SELECT col1,col2 FROM Table1 WHERE col3 IN (VALUES (1),(2),(3) )
How can I perform this operation in python with an array?
Here was an attempt, but has an issue binding:
dataArr = (1,2,3)
c.execute( "SELECT col1,col2 FROM Table1 WHERE col3 IN (?) ",(dataArr,) )
ret = c.fetchall()
I have also tried the string contcatenation from this question but it flattens the rows into a single array. The benefit is that it performs 2~3x faster than a loop for me, which is the main concern.