Showing results for 
Search instead for 
Did you mean: 

PD checks don't spot exceeding max length for MySQL char data type

0 Kudos

I've inherited a Logical Data Model in PowerDesigner (16.1), which has an attribute defined with a Standard Data Type of 'Characters' and length 1024. Leaving aside the fact that Variable Characters would probably be more suitable, I forward-engineered a PDM from this, with MySQL v5.0 as the target DBMS, and generated a DDL script.

A developer has pointed out to me that the max length of char in MySQL is 255 (which, admittedly, I didn't know). Should PD's Check Model parameters have picked up that the chosen data type was exceeding the allowed length? I ran the checks for the LDM and PDM, and it didn't flag it. My hunch is that I shouldn't have expected the tool to spot this.

Thanks, Antony

View Entire Topic
Active Contributor
0 Kudos

This is something I would expect the tool to spot - it should be a DBMS-specific check. As I'm sure you know, it's simple to create one yourself, which could include an automatic fix, to change the data type (or domain) to a valid one. It's a little fiddly, as the datatype property includes the length, and you have to make sure that CanModifyDatatype is true before you can change the data type. You'd also need to check if it's a foreign key.

Alternatively, if you want all logical chars to be varchar, change the data type mapping in the DBMS definition.