sql_translator.pl - convert an SQL database schema
For help:
./sql_translator.pl -h|--help
For a list of all parsers and producers:
./sql_translator.pl -l|--list
To translate a schema:
./sql_translator.pl -f|--from|--parser MySQL -t|--to|--producer Oracle [options] file Options: -d|--debug Print debug info --trace Print parser trace info --no-comments Don't include comments in SQL output --show-warnings Print to STDERR warnings of conflicts, etc. --add-drop-table Add 'drop table' statements before creates --xlate=foo/bar,baz/blech Overrides for field translation
This script is part of the SQL Fairy project (http://sqlfairy.sourceforge.net/). It will try to convert any database syntax for which it has a grammar into some other format it knows about.
If using "show-warnings," be sure to redirect STDERR to a separate file. In bash, you could do this:
$ sql_translator.pl -f MySQL -t PostgreSQL --show-warnings file.sql \ 1>out 2>err
Ken Y. Clark <kclark@cpan.org>
SQL::Translator.
To install SQL::Translator, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SQL::Translator
CPAN shell
perl -MCPAN -e shell install SQL::Translator
For more information on module installation, please visit the detailed CPAN module installation guide.