cancel
Showing results for 
Search instead for 
Did you mean: 

Incorrect FK Specification

Former Member
0 Kudos

When generating a LDM from a CDM, PowerDesigner builds a FK reference as an "Integer" from a PK specified as a Serial (8). When the PDM is created the FK reference is transformed to an "INT4".  The FK reference should be specified as a " Long Integer" so that the FK reference in the PDM would become "INT8".  Where can this conversion or mapping be modified so that we so not have to manually update the column specifications in the LDM?   See example below.   We are using the PostgreSQL 9 DBMS properties file.

Accepted Solutions (0)

Answers (3)

Answers (3)

marc_ledier
Active Participant
0 Kudos

Hi,

Stefan's answer is correct.

The CDM to LDM generation does not change the data type. PowerDesigner transforms CDM serial to serial in LDM.

The LDM to PDM generation use a data-type mapping specified in the XDB (Database Definition File).

You can easily change it by manipulating the table Stefan pointed out.

That said, I just tried your issue and got a SERIAL data type in the PDM table. Which match the expected type defined in pg doc (http://www.postgresql.org/docs/9.1/static/datatype-numeric.html) but does absolutely not match your results.

If you want to have bigserial instead of serial, you can also change the map to do it.

Regards,

Marc

Former Member
0 Kudos

Hi John,

Were you able to resolve this issue. I ran into same problem and looking for a solution.

Thanks,

Arvin

Former Member
0 Kudos

Arvind, good afternoon. We have not found a solution to this issue.   The CDM to LDM generation should build a FK reference as a long integer when the PK is a Serial (8).    What we do is after the  LCM is generated we sort the List of Entity Attributes by Data Type to find those items with a integer data type and manually change those that are FK references to long integer.  

Since PowerDesigner can maintain changes made in the LDM regardless of how many time the LDM is generated, correcting the model this way is a one time effort.

Former Member
0 Kudos

John,

Thank you for your quick response.

This is the response, I got from SAP support.

You need either manually or using script to change data type. The mapping between type serial and integer is hard coded in Powerdesigner engine. So, there is no way you can change it.


If I end up developing something then I will definitely share it with you.


Regards,

Arvin

former_member186838
Active Participant
0 Kudos

Hi John,

you can't change anything for the CDM to LDM generation but you can change the data type mapping of ther internal to physical model of your DBMS in the ::Script\DataType\AmcdDataType section.

Best regards

Stefan