cancel
Showing results for 
Search instead for 
Did you mean: 

Table/View Generation from PDM PD 16.5 SP03 PL01

Former Member
0 Kudos

I have a question regarding table/view generation from PDM.

We are using Teradata 14.

I have one PDM with one table named XYZ.

I want to generate this table into Teradata from PowerDesigner directly. This is easy and I know how do it.

What I am looking for is if we can generate two different views as well named XYZ_BV and XYZ_AV from this table into the database. I don't want to create a view from the table into PowerDesigner which I know, but I want to generate from PowerDesigner table into the database directly. I am trying to keep only one table(XYZ) in PoweDesigner and create as many views off this table directly into the database. Is it possible?

Table: XYZ  -----> 1 on 1 view XYZ_BV (Exact Replica of the table XYZ).

Table XYZ: ------> Remove a couple of columns from XYZ and it becomes XYZ_AV view.(It's not an exact replica of the table XYZ)

Note: All three (Table XYZ, View XYZ_BV, View XYZ_AV) will be generated into three different databases, so they don't belong to one single database as well.

Please let me know what I am thinking is possible or not?

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks Stefan and Mark. I will try the way you guys have suggested. Appreciate your help.

--Perry

marc_ledier
Active Participant
0 Kudos

Hi,

This can be done with editing the XDB (backup first)

I would add new templates in Profile's table category containing the code to create the view.

Say

createxyzTable:

create view %Code%_xyz (%getColnList%) as select * from %Code%

This refers to another template getColnList:

.foreach_item(Columns)

%Code%

.next(", ")

Then you can either add the call (%createxyzTable%) to the End script of the table (this allow to add view to some tables only) or you add it in "AfterCreate" table item and get it on all tables.

Marc

marc_ledier
Active Participant
0 Kudos

Hi again.

I did not see the "Note" about three distinct databases. In that case, you may want to use one generated file for each database which will gather your create view statements.

Search in help for "Generated Files" and/or Extension/Customizing for more help.

Marc

former_member186838
Active Participant
0 Kudos

Hi,

there are two event handlers BeforeDatabaseGeneration  and AfterDatabaseGeneration.

I would use them to generate the views via VB script in BeforeDatabaseGeneration and remove them in AfterDatabaseGeneration.

You have to create an extension and add the metaclass Model under "Profile".

There you can add the two events and do your VB Script for each handler.

There is as well a VB Script sample for creating views in the Installation directory under the folder "VBScripts".

HTH

Stefan

former_member185199
Contributor
0 Kudos

i wonder how you understood what he wanted.