Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: FrostScYthe on May 03, 2007, 06:01:47 pm

Title: Generating SQL ?
Post by: FrostScYthe on May 03, 2007, 06:01:47 pm
Is it posible to generate SQL code from a Model of tables in Enterprise Architect?
Title: Re: Generating SQL ?
Post by: thomaskilian 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.
Title: Re: Generating SQL ?
Post by: «Midnight» 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
Title: Re: Generating SQL ?
Post by: thomaskilian on May 05, 2007, 09:39:46 pm
Oh. If that's what he means by SQL Code...
Title: Re: Generating SQL ?
Post by: «Midnight» 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.
Title: Re: Generating SQL ?
Post by: dmcwhinnie 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.
Title: Re: Generating SQL ?
Post by: «Midnight» 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
Title: Re: Generating SQL ?
Post by: thomaskilian on May 10, 2007, 10:46:09 am
Or you come back to my first response...
Title: Re: Generating SQL ?
Post by: «Midnight» 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...
Title: Re: Generating SQL ?
Post by: dmcwhinnie 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.
Title: Re: Generating SQL ?
Post by: thomaskilian 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?