executemany throws error when I try to insert a list of tuples that is generated using list compression, but works when insert the same list if it’s hard-code. When I try:
a=[(i[0][0],i[0][1],i[0][2],i[1][0],i[1][1],i[0][5]) for i in zipList_updates]
c.executemany('INSERT INTO Households VALUES(?,?,?,?,?,?)',a)
I get: InterfaceError: Error binding parameter 4 - probably unsupported type.
But when I hard-code the list of values as:
b=[('1000000US371830501001017', 'White', 2, '150-200K', 184, 'Renter'),\
('1000000US371830501001017', 'Asian', 2, '125-150K', 250, 'Renter')]
and try:
c.executemany('INSERT INTO Households VALUES(?,?,?,?,?,?)',b)
it works fine. When I check a==b , I get True.
I don't understand how it's possible as a and b seems to be the same thing.