Python Forum
Python Error- TypeError: ('Params must be in a list, tuple, or Row', 'HY000') - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Python Error- TypeError: ('Params must be in a list, tuple, or Row', 'HY000') (/thread-28657.html)



Python Error- TypeError: ('Params must be in a list, tuple, or Row', 'HY000') - DarkCoder2020 - Jul-28-2020

I have a python error TypeError: ('Params must be in a list, tuple, or Row', 'HY000') but I don't know how to fix any suggestions my code is below:

if len(strSsn.strip()) > 0:
   s20tuple = ("MICROS",strStoreId,strInDate,strOutDate,strInTime,strOutTime,
               formatSsn(strSsn),intPayRate,intTips,intReghours,intOthours,strPositionde,
               intEmpAdj)
   s20tuple = tuple(s20tuple)


   server = '*******' 
   database = '******' 
   username = '************' 
   password = '************' 
            
   with pyodbc.connect('DRIVER={SQL Server Native Client 10.0};SERVER='+server+';DATABASE='+database+';UID='+username+';PWD='+ password) as myDbConn:
        with myDbConn.cursor() as cursor:
             cursor.executemany("""INSERT INTO s20data(clockdata,storeid,indate,outdate,indatetime,outdatetim,
                                 ssn,payrate,tips,reghours,othours,positionde,empadj) VALUES {?,?,?,?,?,?,?,?,?,?,?,?,?""",s20tuple)
             myDbConn.commit()

      



RE: Python Error- TypeError: ('Params must be in a list, tuple, or Row', 'HY000') - Larz60+ - Jul-28-2020

please post complete unaltered error traceback (in error tags)
It contains valuable data which can be used in diagnosis.


RE: Python Error- TypeError: ('Params must be in a list, tuple, or Row', 'HY000') - DarkCoder2020 - Jul-28-2020

How I do that?


RE: Python Error- TypeError: ('Params must be in a list, tuple, or Row', 'HY000') - Larz60+ - Jul-29-2020

you can use cut and paste to capture error, then surround with error tags
you can also highlight the error message after pasting and then click on the X (with circle) icon.
see: https://python-forum.io/misc.php?action=help&hid=25