I couldnot find this anywhere , so asking it here.
Say I have a query such as
SELECT * from TABLE WHERE col in ('a', 'b', 'c', .......);
This data is provided by list of strings and it is quite huge with length more than 100. What is efficient way of parameter binding in such scenario.
I am currently doing
'SELECT * from TABLE WHERE col in {0}'.format(str(tuple(LIST_OF_DATA)))
Another way I could think of is prepare a bind string with length of list such as ','.join(itertools.repeat("%s", len(LIST_OF_DATA)))
and concatenate to query.
Is there any other way other than these to bind with in query a list of data ?