cancel
Showing results for 
Search instead for 
Did you mean: 

powerdesigner automatic relationship defining

Former Member
0 Kudos

Hi,

I'd like to know if there is an option to automatically define relationships between entities (CDM) or between tables (PDM) based on common column names (Primary/foreign keys). I have over 65 objects so its a painful task to do it manually.

Thanks,

Asif.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Of course, the same column name in 2 tables dies not necessarily imply a foreign key - primary key relationship. Nor do different column names in 2 tables imply the absence of such ...

GeorgeMcGeachie
Active Contributor
0 Kudos

You're right. That's why (some?) data discovery tools look at the actual data when looking for relationships. I think Experian Pandora does, I don't know about any others.

former_member438037
Participant
0 Kudos

Actually, for PDM, there is an option you can select. Go to Tools - Rebuild Objects - Rebuil References... It will automatically create references between PK column(s) in one table and columns with the same code and data type in another table. More details in PD help:

Data Modeling - Building Data Models - Physical Diagrams - References (PDM) - Rebuilding References.

HTH,

Ondrej

GeorgeMcGeachie
Active Contributor
0 Kudos

There you go, Ondrej, answering the REAL question! (unlike me, who answered a different one)

GeorgeMcGeachie
Active Contributor
0 Kudos

There isn't an option you can select, but you can achieve what you using a simple script, which can be triggered/run in several ways. I suggest the best way to do it is to define a custom check that does the following:

  1. constructs the name of a relationship/reference according to the naming standard
  2. if the current object name doesn't match the constructed name, return an error
  3. the autofix script for the error will rename the object according to the standard

In the script, be careful to avoid duplicate names - will need to check if proposed name already exists, if it does, suffix it with a (number)