Skip to content
Advertisement

Inser list of ids into table aioodbc (pyodbc)

I am using aioodbc which is basically async pyodbc. My table has only one columns ClaimID. I am trying to do bukl insert list of ids like [1, 2, ,3 ,4 ,5 ,6 ... n] (up to 21k)

JavaScript

where ids is a python list of ints. I am getting error

JavaScript

How to perform bulk insert of list of ids ?

Advertisement

Answer

executemany needs [ [1], [2], [3], [4], [5], [6] ... [n]]

So you have to convert it to nested list

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement