title: Using executemany() with PYPYODBC
body: <p>My project is currently using <code>pypyodbc</code> Python library to connect to DB2 database, my source is a MS SQL server and I need to read data from that and load the data to a DB2 table. The data volume is million rows and I am attempting to use the <code>executemany()</code> method to load 50 records in one execution but I keep getting the error:</p>
  
  <blockquote>
    <p>data must be in a list, tuple or row</p>
  </blockquote>
  
  <p>I did use <code>list</code> function to typecast my cursor results but it still doesn't work. The data in the result set is in the format <code>[(record1),(record2)]</code>. The code snippet is as below:</p>
  
  <p>Tried typecasting the sql results set tuple as well </p>
  
  <pre><code># use pypyodbc to establish a connection - db2_conn. 
  cur = db2_conn.cursor()
  cur.execute('...a query with 10 columns...')
  result = cur.fetchmany(50)
  
  insert_query = 'insert into db2_table (col1,col2,col3,...) values (?,?,?,..)'
  cur.executemany(insert_query, list(result))
  cur.commit()
  </code></pre>