Skip to content
Advertisement

TypeError: Params must be in a list, tuple, or Row in Python

I built out a python script the retrieves data from Auth0 and publish it to Ms-sql but im getting errors

When I did the print statements,

everything printed great. but when i used SQL commands to try to populate my table, it returns this error

Any suggestions/insights appreciated!

Advertisement

Answer

executemany executes the same request several times with different parameters. Because of that it is expecting a sequence as second parameter (such as a list of list, or a list of tuples…)

In your code you only want to do a single request for each iteration of your for loop. Replace executemany by execute and it should work fine.

EDIT: For your second issue, before the line:

You can fill the empty values with a for loop:

EDIT 2: To create a datetime object from a string, you can use strptime():

You can then format it using strftime():

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