Book a Demo

Author Topic: Generating DDL for MySQL from Oracle Schema  (Read 4108 times)

rknr55

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Generating DDL for MySQL from Oracle Schema
« on: November 22, 2005, 11:08:03 am »
Hi,

I've created a data schema for Oracle with EA and have been generating DDL from the schema for Oracle.

Now, I would like to generate DDL for MySQL from the schema.  What is the best way to go about doing it?

One way I'm thinking of doing it is as follows:
1) take a copy of the the EAP file and rename it
2) Open it with EA
3) select each table, open its properties dialog, and change the database to 'MySQL' and save it.  I've about 50 tables.
4) generate DDL out of it

I don't like the above idea as I've to now maintain two files and very prone to error.  Is there any better way to do this?

Thanks
-Ron


thomaskilian

  • Guest
Re: Generating DDL for MySQL from Oracle Schema
« Reply #1 on: November 22, 2005, 12:31:06 pm »
The best way is always to approch from the PIM and using code transformation for either Oracle and MySQL. You can probably also find your transformation from Oracle to MySQL...

hd

  • EA Administrator
  • EA User
  • *****
  • Posts: 312
  • Karma: +0/-0
    • View Profile
Re: Generating DDL for MySQL from Oracle Schema
« Reply #2 on: November 22, 2005, 01:13:32 pm »
...or you could convert the package.

From the package context menu, select Code Engineering | Reset DBMS Options...

See EA Help - Data Modeling | Data Type Conversion for a Package.

rknr55

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
MySQL--InnoDB
« Reply #3 on: November 22, 2005, 02:32:46 pm »
Thanks for response.  

One more question:

I was able to select the package and flag all the tables to have 'mysql' as the database type.  I can now generate the DDL for mysql.

However, I would like to append ENGINE=InnoDB at the end of each create table statement.  I went through the guide and it says how to create a 'Engine=InnoDB' tag. I could select a table from the schema and create a tag and generate the DDL...which puts 'ENGINE=InnoDB'.  The help section tells how to do this for a table.  However, I will need to do this for all the tables in the schema.

Is there a way I can tell EA to put the tag for all the tables  I've more than 50 tables and I don't want to do this for .each table.

Thanks

thomaskilian

  • Guest
Re: Generating DDL for MySQL from Oracle Schema
« Reply #4 on: November 22, 2005, 11:34:53 pm »
Only by automation. I guess with Perl it would take you 5-10 minutes to accomplish what you need (select elements, loop through selection, apply tag).