Book a Demo

Author Topic: Customize DDL code generation  (Read 4191 times)

mutano

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Customize DDL code generation
« on: December 07, 2006, 11:31:34 am »
How can I customize the DDL code generation?

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Customize DDL code generation
« Reply #1 on: December 07, 2006, 12:03:25 pm »
Could you be more specific about what you want to customize?
No, you can't have it!

mutano

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Customize DDL code generation
« Reply #2 on: December 07, 2006, 01:07:08 pm »
I created a new database with the defined datatypes for Ingres. The next step is generate the DDL script. However, some parts of this script must be customize, like the default clause or the code for triggers and procedures, for instance.

I also want to generate code for grant on tables. How can I do this?

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Customize DDL code generation
« Reply #3 on: December 07, 2006, 03:08:57 pm »
I think you are a bit beyond what EA will do without some intervention.

First, take a look at Simon's reply in this thread: http://www.sparxsystems.com.au/cgi-bin/yabb/YaBB.pl?board=general;action=display;num=1165492377
You have at least two options here. You could generate the DDL normally, then process it with some custom application or XSLT or whatever. Or, you could write an add-in of sorts to modify generate and modify the DDL.

As far as I know you cannot modify the DDL generation process of EA itself. However, I'm not sure of this - check for additional posts in case Sparx (or somebody) knows of a way to do this.

David

[EDIT: See also Simon's reply to this one: http://www.sparxsystems.com.au/cgi-bin/yabb/YaBB.pl?board=general;action=display;num=1165470891]
« Last Edit: December 07, 2006, 03:10:50 pm by Midnight »
No, you can't have it!

thomaskilian

  • Guest
Re: Customize DDL code generation
« Reply #4 on: December 08, 2006, 03:36:57 am »
I posted a few about DDL generation. In principle you can use the standard code generation templates to do what you want. Unfortunately the DDL generation is hardwired and not available as template. So you have to start from the very beginning.

Maybe other users in a similar situation have already done something and like to share their code?

mutano

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Customize DDL code generation
« Reply #5 on: December 15, 2006, 09:51:36 am »
Which macros can I use for database code generation? For example, the length of varchar columns.

thomaskilian

  • Guest
Re: Customize DDL code generation
« Reply #6 on: December 16, 2006, 06:48:01 am »
I'm afraid you have to start with the very beginning. Take one of the C* generator macros and play around. It should not be too difficult.

mutano

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Customize DDL code generation
« Reply #7 on: December 19, 2006, 05:44:20 am »
My question is related to specific fields/informations from <<table>> or <<column>> stereotype. For example, for the varchar(10) datatype the tag attType returns only varchar, without the length. How can I get the length?

There are other fields/informations that are specific as involved columns of a primary key or foreign key. In the documentation there is no information about this.
« Last Edit: December 19, 2006, 09:48:33 am by mutano »

thomaskilian

  • Guest
Re: Customize DDL code generation
« Reply #8 on: December 20, 2006, 04:18:35 am »
I think that this once has been posted by one of the Sparxians here on the automation board, but I can't recall who, when and what thread. Try a search or maybe one of Sparx will respond.