Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 write csv data into teradata table
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:
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 :
TRAN_STMT_DESC tran_amt tran_cnt VENMO 100 1 VENMO 30 1 VENMO 8 1
please can any one help me on this

Larz60+ wrote Feb-13-2019, 01:07 AM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.

I fixed for you this time, please use BBcode tags on future posts.

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  How to extrac a data table from Pdf document using Python Amit0503 1 209 May-15-2019, 05:38 AM
Last Post: Larz60+
  Read and write data to CSV files kartik 1 165 Mar-12-2019, 06:16 AM
Last Post: Yoriz
  Transposing Table salihozturk 3 219 Mar-03-2019, 06:55 PM
Last Post: salihozturk
  Issue while inserting data into Teradata via python dataframe sandy 2 321 Feb-10-2019, 08:06 PM
Last Post: sandy
  Connect a Teradata DB to Python OscarBoots 10 581 Jan-31-2019, 10:23 PM
Last Post: OscarBoots
  I can't write my data to the data file , Why? canatilaa 4 350 Jan-08-2019, 10:50 PM
Last Post: canatilaa
  Storing MySQL BIT Data Type data in python variable krushna 2 357 Dec-31-2018, 01:28 AM
Last Post: krushna
  times table aocii 3 431 Dec-26-2018, 01:30 PM
Last Post: metulburr
  How to pivote table SriRajesh 1 334 Dec-06-2018, 07:14 AM
Last Post: scidam
  read select data from one file and write to another Shameendra 1 363 Oct-16-2018, 06:46 PM
Last Post: ichabod801

Forum Jump:

Users browsing this thread: 1 Guest(s)