Book a Demo

Author Topic: Generating SQL ?  (Read 6264 times)

FrostScYthe

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Generating SQL ?
« on: May 03, 2007, 06:01:47 pm »
Is it posible to generate SQL code from a Model of tables in Enterprise Architect?

thomaskilian

  • Guest
Re: Generating SQL ?
« Reply #1 on: May 04, 2007, 03:53:50 am »
I wonder what you intend with that. However, the code generation templates could well be used to also generate SQL.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Generating SQL ?
« Reply #2 on: May 04, 2007, 04:17:20 am »
First, make sure you have selected the package containing the model in the Project Browser. Also make sure that you have not selected one of the tables in your model diagram (or the SQL will be limited to that table only).

From the main menu choose Project | Database Engineering | Generate Package DDL. Fill out the dialog.

This should get you started.

David
No, you can't have it!

thomaskilian

  • Guest
Re: Generating SQL ?
« Reply #3 on: May 05, 2007, 09:39:46 pm »
Oh. If that's what he means by SQL Code...

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Generating SQL ?
« Reply #4 on: May 06, 2007, 05:52:22 am »
No sure Thomas. But if that is what he meant and he did not have a package selected, the results would fit the description given.
No, you can't have it!

dmcwhinnie

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Generating SQL ?
« Reply #5 on: May 07, 2007, 12:29:34 pm »
Any chance of customizing the output of the SQL?  There are additional attributes that EA does not use when generating that we need to include.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Generating SQL ?
« Reply #6 on: May 07, 2007, 02:29:16 pm »
Often asked for, but no action yet.

Perhaps in 7.0, but that's just part of my wish list.

David
No, you can't have it!

thomaskilian

  • Guest
Re: Generating SQL ?
« Reply #7 on: May 10, 2007, 10:46:09 am »
Or you come back to my first response...

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Generating SQL ?
« Reply #8 on: May 10, 2007, 01:42:14 pm »
Quite correct Thomas, as always.

This issue blew up on my current project (yet again) today.

We live in hope...
No, you can't have it!

dmcwhinnie

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Generating SQL ?
« Reply #9 on: May 12, 2007, 06:12:56 am »
So does anyone on the community have SQL templates they are willing to share with the rest of us?  I have never EA, and am still learning, so this would help me get on my way faster.

thomaskilian

  • Guest
Re: Generating SQL ?
« Reply #10 on: May 12, 2007, 09:35:44 pm »
Quite some have talked about this here on the board. Don't know who ever started with that. But I think if you are forced to do it, creating a code gen tamplate should not be too difficult. There are some build-in templates which could be copied and modified for this purpose. But you would need to learn it.

Btw.: anyone from Sparx who could tell us why DDL is created NOT by  code gen template but instead by some completely different wizzardry?