Skip to content
Advertisement

Is it possible to write a python list into a database with pymssql?

I am tyring to write a python list via pymssql into a database table. I am aiming to write each list entry into a different row of the same column.

When trying this I am getting the error:

ValueError: ‘params’ arg () can be only a tuple or a dictionary.

Is there a way with pymssql or should I use something else?

My code:

JavaScript

Advertisement

Answer

You can use executemany:

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