Exporting from OpenOffice Base database to SQL

I was wanting to export the contents and design of an OpenOffice.org Base database to SQL with the intent of migrating to MySQL. I struggled to find out how to do this, but finally found out how.

To generate an SQL file that contains both the contents and the data of the database I used the following command from the “Tools –> SQL…” menu:

SCRIPT 'C:\temp\file.sql'

When I tried to write it to the C:\ root directory I got a security error, but using another directory worked fine.

Thanks to http://www.oooforum.org/forum/viewtopic.phtml?t=32333 for pointing me in the right direction.

Incidentally, on my way to the final solution I also came across the following command to generate a CSV file of a table’s contents:

SELECT * INTO TEXT "output_csv_file_name" FROM "table_name"

The version of OpenOffice I was using was OpenOffice.org 3.3.0 – OOO330m20 (Build:9567) and I running this on a Windows 7 machine.

Comments

  1. Wow - nice job, especially SCRIPT solution.
    Just looking for that.
    And it works!

    Thanks.

    ReplyDelete
  2. Works great! Saved my day!
    Thanks!

    ReplyDelete
  3. that's what i've been looking for :)
    thanks

    ReplyDelete

Post a Comment

Popular posts from this blog

Solution: Getting macOS Messages to work with Google Chat / Talk / Hangouts in High Sierra

Using Raspberry Pi as a Time Capsule to backup a Mac

IT & Enterprise Architecture Conference 2015 - Day 2