Python Forum
Load table from Oracle to MYSQL using python
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Load table from Oracle to MYSQL using python
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]))


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

Please suggest

Possibly Related Threads…
Thread Author Replies Views Last Post
  Load the data from multiple source files to one table amy83 2 153 Apr-27-2021, 12:33 AM
Last Post: Pedroski55
  Python and MySQL Pedroski55 5 412 Mar-23-2021, 06:40 AM
Last Post: ndc85430
  Load data from One oracle Table to Multiple tables amy83 1 326 Dec-02-2020, 01:57 AM
Last Post: Larz60+
  Creating table in MySQL db with decimal number issue dangermaus33 7 498 Nov-20-2020, 10:40 PM
Last Post: dangermaus33
  Calling Oracle REST SQL from Python johnjacob 2 385 Nov-05-2020, 04:19 AM
Last Post: johnjacob
  Python to Oracle Conn Issue chvsnarayana 2 417 Sep-06-2020, 04:33 PM
Last Post: Larz60+
  Fetch Oracle DB rows & print it in HTML file with table's col headers in table format tssr_2001 1 746 Sep-04-2020, 01:39 PM
Last Post: ibreeden
  Python MySQL ogautier 0 571 Sep-03-2020, 03:54 PM
Last Post: ogautier
  Insert into mysql through python LaKhWaN 0 501 Aug-26-2020, 04:54 AM
Last Post: LaKhWaN
  How to load log.txt directly into python codes? sparkt 6 683 Aug-21-2020, 03:51 PM
Last Post: sparkt

Forum Jump:

User Panel Messages

Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020