Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DatabaseError: ORA-00928: missing SELECT keyword
- def Create_list():
- reader = csv.reader(open("Query_result_combined.csv","r"))
- lines=[]
- for line in reader:
- lines.append(line)
- print(lines[:1])
- print(lines[:2])
- return lines
- def Insert_data():
- db_user = "XXXXXXX" # replace this with correct user name
- db_password = "********" # Set the environment variable DB_PASSWORD
- db_connection_name = "***********"# repalce this with correct database name
- #db_driver = "oracle.jdbc.OracleDriver","C:/Oracle/32bitclient/product/11.2.0/client_1/jdbc/lib/ojdbc6.jar"
- print("Connecting Now!!")
- con = cx_Oracle.connect(db_user,db_password,db_connection_name)
- print("Connected to Oracle!!")
- lines=Create_list()
- #print lines
- cur=con.cursor()
- print("Inserting data")
- cur.executemany("INSERT INTO BRIODB.A608232_QUERY_RESULT ('InteractionId','QueryId','Score','StartOffsetInMs','EndOffsetInMs','SpeakerRole','QueryIdentity','SpeakerId') VALUES(:1,:2,:3,:4,:5,:6,:7,:8)",lines)
- con.commit ()
- cur.close()
- print("completed")
- [['InteractionId', 'QueryId', 'Score', 'StartOffsetInMs', 'EndOffsetInMs',
- 'SpeakerRole', 'QueryIdentity', 'SpeakerId']]
- [['InteractionId', 'QueryId', 'Score', 'StartOffsetInMs', 'EndOffsetInMs',
- 'SpeakerRole', 'QueryIdentity', 'SpeakerId'], ['34118470', '27', '45.63345',
- '89900', '90980', 'U', 'e54fd492-8877-4534-997b-9dbe9a8fbd74', '']]
- Inserting data
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement