Book a Demo

Author Topic: How to skip tables in DDL template  (Read 6970 times)

ChrisMW

  • EA User
  • **
  • Posts: 90
  • Karma: +2/-0
    • View Profile
How to skip tables in DDL template
« on: October 31, 2016, 09:08:02 pm »
Hi,

As EA doesn't process Oracle's materialized views the way I'd like, I'm looking to adjust the DDL scripts, bascially skip dropping / creating tables that contain a tag. But not really finding a good example. I found DDL_TABLE_TAGVALUE ([tagName]) mentioned, and in the DDL Template editor I see the script create table.

Simply adding an
%if DDL_TABLE_TAGVALUE("mytag") != ""%
%endTemplate%

To the create table did not alter a single thing. Ideally I want to skip the tables I tag and add a comment to the DDL saying it was skipped for some reason.

Not having much luck in finding a good starting point on how to do it, but then, this is a part of EA I've not really explored a lot before, I'd appreciate some example, or links to where to look for the howto kind of information.

TIA

Chris
« Last Edit: November 12, 2016, 07:40:45 am by ChrisMW »

ChrisMW

  • EA User
  • **
  • Posts: 90
  • Karma: +2/-0
    • View Profile
Re: How to skip tables in DDL template
« Reply #1 on: November 02, 2016, 06:24:56 pm »
After some further exploration, it seems if I manually add a tag to an element with the table stereotype, you cannot read that tag in the DDL script. Why?

My plan was to manually tag the materialized views and then when I generate the DDL, skip those tables with that tag. But neither DDL_TABLE_TAGVALUE  or tableProperty:"propertyName" return the tag value. I defined a new tag value 'MaterializedView' and set it to Yes. In the DDL script I simply try to read the value and print it in the DDL. It comes up empty. Suggestions appreciated.....

ChrisMW

  • EA User
  • **
  • Posts: 90
  • Karma: +2/-0
    • View Profile
Re: How to skip tables in DDL template
« Reply #2 on: November 02, 2016, 07:56:24 pm »
I can read the tags that EA created, but not the ones I add manually. Is there a list of TAGS that is maintained somewhere?

ChrisMW

  • EA User
  • **
  • Posts: 90
  • Karma: +2/-0
    • View Profile
Re: How to skip tables in DDL template
« Reply #3 on: November 08, 2016, 12:04:35 am »
Does anyone know why, if you add tables, I can add tags/values to that table, but cannot query them from within a DDL. I can query the tags that EA created during the ODBC import. I will try and see what happens when I manually add a table, but it seems there's a tag set that comes with the table stereotype and Oracle database.

All I want to do is to mark the tables that the ODBC import sees, that belong to a materialized view.When I write the DDL, those marked tables should be skipped. If I could read the tag I add, this should work. Another option would be to not import the table, but that route seemed much more of an impossibility. I could work around the issue by misusing something to mark the 'belongs to a materialised view', but that seems a risky approach and will make usng such a field for its intended purpose impossible.

If anyone has another idea to solve this, I'd welcome suggestions. I use EA to
1. import a live database -> to document the physical model
2. to maintain data model documentation (i.e. elaborations per element / attribute)
3. to export a DDL, which is then checked by an external program for certain structural issues.

I need to skip the tables that are a result of a materialized view, in either 1 or 3. If in 3, I need to mark it as a characteristic as the table, rather than deleting the table, which is too dangerous.