Jul-28-2020, 03:49 PM
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()
