MySQL Forums
Forum List  »  Connector/Python

HOW TO use SQL IN Clause in cursor.execute()
Posted by: yg li
Date: October 23, 2010 12:52AM

sTuple = ('a','b','c','d',....) # len(sTuple) > 1000
cursor.execute("""
SELECT *
FROM table
WHERE col_table IN (%s)
""",sTuple)

seems doesn't work.



Edited 1 time(s). Last edit at 10/23/2010 12:53AM by yg li.

Options: ReplyQuote


Subject
Written By
Posted
HOW TO use SQL IN Clause in cursor.execute()
October 23, 2010 12:52AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.