for fi in dirs:
file_nm = fi
if file_nm == "XXX_PRODCost.xlsx":
print 'Beginning file:', file_nm
wb=open_workbook('Labor_Cost' + '\\' + file_nm)
sh=wb.sheet_by_name('New Dept Data')
values=[]
for r in range(1, sh.nrows):
v = [None]*8
#v[0] = str(sh.cell(r,0).value)[:6] # YM
v[3] = sh.cell(r,2).value #
#v[1] = sh.cell(r,1).value #
v[0] = sh.cell(r,4).value # DEPT
v[1] = sh.cell(r,5).value # DEPT Job
v[4] = time # append date
v[2] = sh.cell(r,6).value # PROD #
v[7] = sh.cell(r,7).value #
v[8] = sh.cell(r,3).value #
values.append(tuple(v))
for i in lst_split(len(values)):
cnxn.cursor().executemany('insert into LABOR."stgLaborFlagsX" values (%s,%s,%s,%s,%s)', values[min(i):max(i)+1])
Я продолжаю получать эту ошибку:
Traceback (most recent call last):
File "xxx_ALL.py", line 128, in <module>
cnxn.cursor().executemany('insert into LABOR."xxxxPROD" values (%s,%s,%s,%s,%s,%s,%s)', values[min(i):max(i)+1])
File "C:\Python27\lib\site-packages\snowflake\connector\cursor.py", line 702, in executemany
param, self))
TypeError: not all arguments converted during string formatting