Book a Demo

Author Topic: Create Temporay Table  (Read 4983 times)

lfernigrini

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Create Temporay Table
« on: May 24, 2006, 08:48:44 am »
Hello everybody.

I'm a DBA working with Oracle and I'm new with EA.

I have a data model from the previous DBA that contains all of the tables in the database, but we have some temporary tables that are used for some store procedures and they are not in the Model.

I could not find a way to create those tables in EA indicating that they are TEMPORARY TABLES (I need the sentence "CREATE GLOBAL TEMPORARY TABLE instead of the standard "CREATE TABLE" when I generate the DDL definition).

If anyone was able to do somethig similar, please let me know.

Thanks in advance,

Lisandro

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Create Temporay Table
« Reply #1 on: May 24, 2006, 09:15:14 am »
Lisandro,

I believe this has been mentioned in the forum before, and that the answer was that EA cannot model temporary tables at this time.

I cannot remember if this was slated for future consideration. It might be worth a search. If you don't find anything useful (but first try several searches, since YABB produces slightly strange search results) then you could always request it as a feature.

In the meantime it might be possible to write a transformation script that would do this for you. You'd have to seriously think through how you want to design the model, but it should be possible without too much fuss and bother.

David
No, you can't have it!

thomaskilian

  • Guest
Re: Create Temporay Table
« Reply #2 on: May 24, 2006, 11:53:22 pm »
I would expect such a feature to be implemented via a Tagged Value attached to the table. I also don't know whether there is something implemented. If the help does not tell anything, you have to do it manually - and additionally raise an enhancement request.

Regarding Transformation: I'm quite sure that David meant Code Generation (which is not much different). So you could write a Code Generation to spit out DDL from a Table. This should not be too difficult.
« Last Edit: May 24, 2006, 11:55:33 pm by thomaskilian »

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Create Temporay Table
« Reply #3 on: May 25, 2006, 03:19:50 am »
Thomas,

I did mean code generation. While similar, the correct term may save some hours of frustrated searching. Thanks for pointing this out.

David
No, you can't have it!

jaimeglz

  • EA User
  • **
  • Posts: 164
  • Karma: +0/-0
    • View Profile
Re: Create Temporay Table
« Reply #4 on: May 25, 2006, 07:31:25 am »
Hi Ifernigrini,

I suggest the following solution:

1. Create a class stereotype called "temp table".
2. Create the "Oracle" language in the customized code generation templates (Settings -> Code generation templates). Take a look at an existing language template (for example, the C++ templates), so you can understand the basics for your Oracle templates.

Your will only need a File template that lists your classes...

--   DDL / PL/SQL
--   File: %fileName%
--   %eaDateTime%
%list="Class" @separator="\n"%
--  
--   End of gen'd code
--

... a simple class template...

--   Version: %classVersion%
%WRAP_COMMENT(classNotes,genOptWrapComment,"","--
")%
--   %ClassBody%

... and a stereotype override for "temp table" at the Class Body level. Here's my stereo override for the "view" class stereotype:

CREATE OR REPLACE VIEW %className%
AS
%opBehaviour%
;

You will probably not need the opBehaviour for what your want.

3. In the diagram, do a Ctrl + G  in the temp table class, fill in the file you want to generate, and be sure to specify Oracle as the language.

As stated in previous forum contributions, there is a learning curve involved in using customized templates, but this is the way to unleash EA's power. And it certainly has helped me to model, document and maintain hundreds of objects that are not currently supported (views, stereotypes, START scripts...).

Hope it helps,

Jaime
« Last Edit: May 25, 2006, 07:32:45 am by jaimeglz »