Skip to Content

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

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • May 18 at 04:14 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded