Python Forum

Full Version: Python Error- TypeError: ('Params must be in a list, tuple, or Row', 'HY000')
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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()

      
please post complete unaltered error traceback (in error tags)
It contains valuable data which can be used in diagnosis.
How I do that?
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