There are clearly less than 8 columns for the affected row. Debugging using the try/except block:
for n, row in enumerate(recReader, start=1): try: month = row[7] except: print('Row {0}: {1}'.format(n, row))
As a bonus, here is a more efficient way to write your code:
months = {'JAN': 1, 'FEB': 2, 'MAR': 3, 'APR': 4, 'MAY': 5, 'JUN': 6, 'JUL': 7, 'AUG': 8, 'SEP': 9, 'OCT':10, 'NOV': 11, 'DEC': 12] for row in recReader: month = row[7] period_num = months.get(month, None) if period_num: params1 = ['batch_plnapps_oi', row[7], period_num, '20' + row[1][-2:], row[2], row[3], row[4], row[5], row[6], row[8], row[9], row[10], row[11], round(row[12], 12)] ins_stmt1 = "INSERT INTO aif_open_interface(batch_name, period, period_num, year, col03, col04, col05, col06, col07, col09, col10, col11, col12, amount) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?)" fdmAPI.executeDML(ins_stmt1, params1, False) fdmAPI.commitTransaction()