I am reading a csv file with 5 columns and push to oracle table
I know there are lots of resources on this .. But even then I am unable to find a solution for my problem
Code to read the CSV to python :
import csv
reader = csv.reader(open("sample.csv","r"))
lines=[]
for line in reader:
lines.append(line)
print lines
Output :
[['Firstname', 'LastName', 'email', 'Course_name', 'status'], ['Kristina', 'Bohn', '[email protected]', 'Guide to Capnography in the Management of the Critically Ill Patient (CE)', 'Registered'], ['Peggy', 'Lutz', '[email protected]', 'Guide to Monitoring EtCO2 During Opioid Delivery (CE)', 'In Progress']]
Code to push the list to Oracle table :
import cx_Oracle
con = cx_Oracle.connect('username/password@tamans*****vd/Servicename')
ver=con.version.split(".")
print(ver)
cur=con.cursor()
cur.execute("INSERT INTO TEST_CSODUPLOAD ('FIRSTNAME','LASTNAME','EMAIL','COURSE_NAME','STATUS') VALUES(:1,:2,:3,:4,:5)",lines)
con.commit ()
cur.close()
I am getting the error :
DatabaseError: ORA-01484: arrays can only be bound to PL/SQL statements
Please help me solve the issue Thanks in advance