Python Forum
Load table from Oracle to MYSQL using python - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Load table from Oracle to MYSQL using python (/thread-26760.html)



Load table from Oracle to MYSQL using python - himupant94 - May-12-2020

Tried below code to load rows from Source(Oracle) to Target(MYSQL)

for row in source_cursor:
target_cursor.execute("INSERT INTO JOB (SUBJECT_AREA,WORKFLOW_NAME,VERSION_NUMBER,SUBJECT_ID,WORKFLOW_ID,WORKFLOW_RUN_ID,WORKLET_RUN_ID,CHILD_RUN_ID,INSTANCE_ID,INSTANCE_NAME,TASK_ID,TASK_TYPE_NAME,TASK_TYPE,START_TIME,END_TIME,RUN_ERR_CODE,RUN_ERR_MSG,RUN_STATUS_CODE,TASK_NAME,TASK_VERSION_DECIMAL,SERVER_ID,SERVER_NAME) VALUES(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14,:15,:16,:17,:18,:19,:20,:21,:22)",(row[0], row[1], row[2], row[3], row[4], row[5], row[6], row[7], row[8], row[9], row[10], row[11], row[12], row[13], row[14], row[15], row[16], row[17], row[18], row[19], row[20],row[21]))



Error:

File "/usr/local/lib/python2.7/site-packages/MySQLdb/cursors.py", line 187, in execute
query = query % tuple([db.literal(item) for item in args])
TypeError: not all arguments converted during string formatting



Please suggest