Hello,
I am trying this to get some values into SQLServer2017. when I try this code it throws pyodbc.ProgrammingError: The second parameter to executemany must be a sequence, iterator, or generator. How can I fix this
Thanks in advance
I am trying this to get some values into SQLServer2017. when I try this code it throws pyodbc.ProgrammingError: The second parameter to executemany must be a sequence, iterator, or generator. How can I fix this
Thanks in advance
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
for key, value in myDict.items(): for idx,retData in enumerate (value): #everything into dict retData[ "remotecontrol_id" ], idx retData[ "device_id" ],idx retData[ "alias" ], idx retData[ "groupid" ], idx retData[ "online_state" ], idx sqeel = ( """INSERT INTO dbo.devTBLA[remotecontrol_id], [device_id], [alias],[groupid], [online_state])) values(%s, %s, %s, %s, %s, %s, %s)""" ) numRows = cursor.executemany(sqeel, retData) #second parameter to executemany must be a sequence, iterator, or generator. connStr.commit() cursor.close() connStr.close() |