When to create alternative data type mappings
You can create alternative data type mappings for relational data sources.
- To override a default data type mapping
For some wrappers, you can change the format or length of values that are returned. You can change the format or length by changing the data type that the values must conform to. For example, the Oracle DATE data type is used as a timestamp and contains the century, year, month, day, hour, minute, and second. By default, the Oracle DATE data type maps to the TIMESTAMP data type. To return only the hour, minute, and second information, you can override the default data type mapping so that the Oracle DATE data type maps to the TIME data type. When the Oracle DATE columns are queried, only the time portion of the Oracle timestamp values is returned to the federated server.
- When a default mapping does not exist
If a default data type mapping is not available for a data source data type, you must create a mapping for the new data type.
You use the CREATE TYPE MAPPING statement to define new data type mappings. Mappings that you create are stored in the SYSCAT.TYPEMAPPINGS catalog view in the federated database.