Menu

Does executemany() work with SELECT statement

Help
Stever
2006-04-29
2012-09-19
  • Stever

    Stever - 2006-04-29

    I searched around and I cannot find this. But can you use a cursor.executemany() command with SELECT?
    IE:
    MyList = ["Value1", "Value2", "Value3", "Value4"]
    SQL = "SELECT ColA FROM myTable WHERE ColA IN (%s)
    cursor.executemany(SQL, myList)

     
    • Andy Dustman

      Andy Dustman - 2006-05-01

      Yes, but you'd get four seperate statements executed.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.