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
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()