Unsupported Screen Size: The viewport size is too small for the theme to render properly.

Odbc -> Mysql, Deleting Old Rows From Destination

forums forums SQLyog Sync tools, Migration, Scheduled Backup and Notifications Odbc -> Mysql, Deleting Old Rows From Destination

  • This topic is empty.
Viewing 3 reply threads
  • Author
    Posts
    • #10079
      terbonium
      Member

      I am importing from an ODBC source and saving into a MYSQL table. I run the job hourly to keep the destination mysql table up-to-date. The source ODBC table often has rows removed, which must be removed from the destintation MYSQL table. Migration updates rows properly if they have changed, however it will not remove rows that have been deleted in the source. Attached is the migration config.

      192.168.2.132

      xxxxx

      zzzzzz 3306

      [default]

      estore

      mmKit

      select SKURECID, PARTRECID, SKU, QUANTITY from UNNAMED order by RECID

      mmkit

      no

      SKURECID

      parentID

      int

      10

      yes

      no

      yes

      no

      no

      no

      PARTRECID

      childID

      int

      10

      no

      no

      yes

      no

      no

      no

      SKU

      child_partnumber

      char

      16

      yes

      no

      yes

      no

      no

      no

      QUANTITY

      quantity

      decimal

      10

      no

      no

      yes

      no

      no

      no

      no

      MYSQL Data Sync

      [email protected]

      [email protected]

      [email protected]

      smtp-server.neo.rr.com

      25

      yyyy-mm-dd hh:mm:ss

    • #23080
      peterlaursen
      Participant
      Quote:
      The source ODBC table often has rows removed, which must be removed from the destintation MYSQL table.

      yes! we are aware of this. We also have discussed if we can do something about this. But priorities are so that we will only look into this after the MySQL Users Conference (end of April 2007).

    • #23081
      terbonium
      Member
      peterlaursen wrote on Dec 12 2006, 12:07 AM:
      yes! we are aware of this. We also have discussed if we can do something about this. But priorities are so that we will only look into this after the MySQL Users Conference (end of April 2007).

      okay.. well in the mean time is there a fix? is there a way to run a post or pre sql command after the sync is complete? actually, never mind, maybe I'll just do a ODBC->MySQL copy up to the server, then just right my own little script to sync the two tables within mysql. OR.. WAIT, how about this.. could I run one job to copy from the ODBC source to a temporary mysql table, then use the MySQL<->MySQL sync functions to merge the changes between the temp table and the “live” mysql table..

    • #23082
      terbonium
      Member
      peterlaursen wrote on Dec 12 2006, 12:07 AM:
      yes! we are aware of this. We also have discussed if we can do something about this. But priorities are so that we will only look into this after the MySQL Users Conference (end of April 2007).

      IT WORKS!

      Created a local mySQL database on the server which hosts the ODBC data source.

      The sync process runs from a bat file as follows:

      1. Delete all the rows in the local mySQL table

      2. Copy the ODBC source table to the local mySQL table

      3. Sync the local mySQL table with the mySQL table on the internet

      DONE!

      It all happens in less that 10 seconds. The local ODBC copy is very fast. The mySQL->mySQL sync is also very fast, and it is able to catch deleted rows from the local source mysql table as well as any changes or additions.

Viewing 3 reply threads
  • You must be logged in to reply to this topic.