Customizing Datatype Mappings
Go Up to Developing the Logical Model
When creating an entity attribute you can assign it a datatype, which defines how the data is stored in the database along with the length and precision. When you want to generate a physical model from the logical model, the datatype of the logical attribute is translated into a physical datatype. The target datatype used in the logical to physical translation depends on the target platform and the datatype mapping. Physical datatypes are platform specific and can differ depending on your DBMS platform. You can view the specific mappings for each supported platform in the Datatype Mapping Editor. You can either use the default system mappings or create customized mappings.
Using the designated mapping, when generating a physical model ER/Studio Data Architect knows if, for example, the logical CHAR datatype should be converted into a string, C, or remain unchanged. From the datatype mappings ER/Studio Data Architect also knows the length and precision of the physical datatype. ER/Studio Data Architect supports many different database platforms and provides standard/default datatype mappings for each platform. For example, using the default mappings for Oracle 10g and 11g, ER/Studio Data Architect maps FLOAT to BINARY_FLOAT, whereas for Oracle 9i a FLOAT attribute is mapped by default to DOUBLE PRECISION. You can customize the default datatype mappings to create new mappings that better suit your purposes.
Use the Datatype Mapping Editor to customize the datatype mapping as you move your logical models to physical models.
- Choose Tools > Datatype Mapping Editor .
- Display the mapping for the target platform, by choosing a mapping from the Select Mapping list or to create a new mapping, click New Physical Mapping, enter a name for the mapping, and then click OK.
- Make the changes as required, and then click OK.
- In the Datatype Mapping Editor, you can change the Physical Mapping values for every logical datatype.
- In the Datatype Mapping Editor, you can change the Is Default, Default Length, and Default Precision values only if you have not defined a length, precision, or default for the datatype in the logical model.
- Is Default refers to whether the logical type is the default for a given physical type. This is used when reverse-engineering or importing from SQL. Since physical types can be mapped to more than one logical type, when we get a physical type from the database or SQL we need to assign a logical type to it as well. When a physical type is mapped to more than one logical type, the mapping that has Is Default marked as Yes is the one used. A physical type can only have one default logical mapping.
- Default length: Can be negative, as -1 is a valid length for certain datatypes on some platforms.
- Default precision: Can be negative, as -1 is a valid length for certain datatypes on some platforms. -2 indicates that the precision is not used for this data type.
- Click New Custom Datatype to define custom datatypes so the unsupported datatypes will not be assigned a default datatype, such as CHAR (10) when importing, reverse engineering or merging databases that contain those unsupported datatypes.
- Rename a datatype by clicking Rename in the Datatype Mapping Editor.
- Customized datatype mappings are saved as.xml files in the following directory location:
- C:\ProgramData\IDERA\ERStudioDA_17.0\DatatypeMapping .
- In the Generate Physical Model Wizard, the list of datatype mappings that you can choose from is limited to the system mapping for the physical platform and any customized mappings that were based on this system mapping.