Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2003
    Posts
    6

    Unanswered: Migrating from Sybase to MySQL

    I need to move data from a Sybase database to a MySQL database. I use BCP to copy the sybasetables out and mysqlimport to import them into MySQL.

    The problems that I haven't solved yet:

    - The null values in Sybase are represented as 0-length strings in the BCP files. When loading this into MySQL, it is converted to 0 for int columns and empty Strings for char columns etc. Null values have to be represented as \n in the bcp-file in order to be inserted as NULL in MySQL (regardless of the DEFAULT value in the table).

    - Date values has to be represented as e.g. 1999-01-01 in the BCP file, not as 1999-Jan-01

    Is this possible to fix with bcp? Or does anyone have other useful hints, e.g. how to fix this at the MySQL side? Are there any free tools available for migrating data between different RDBMS's?

  2. #2
    Join Date
    Apr 2003
    Posts
    6
    Never mind, I managed to transfer the data by writing a simple java program that moves the data from all tables. It was really simple when using jdbc's getObject/setObject (didn't need to know underlying datatypes). If I had only know how simple it was from the beginning!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •