Python Forum

Full Version: write csv data into teradata table
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi All,
I am writing csv data into Teradata table:
Using below code .. and getting error..

import csv
with open(r"C:\Users\sandy\Desktop\venmo_output1.CSV",'r')as csvfile:
    reader = csv.DictReader(csvfile)
    for row in reader:
        #print(row['TRAN_STMT_DESC'],row['Sum(tran_amt)'], row['Sum(tran_cnt)'])
        curs.execute(""""INSERT INTO PYTHON_LKP(TRAN_STMT_DESC,tran_amt, tran_cnt )VALUES(?,?,?)""",row)
here goes my error:
Error:
ProgrammingError: ('42000', '[42000] [Teradata][ODBC Teradata Driver][Teradata Database] String not terminated before end of text. (-3760) (SQLPrepare)')
My csv file generated from python using to_csv function.
data is like this in csv file :
Output:
TRAN_STMT_DESC tran_amt tran_cnt VENMO 100 1 VENMO 30 1 VENMO 8 1
please can any one help me on this

thanks