Data type mappings and the federated database global catalog
Local data type definitions are stored in the SYSCAT.COLUMNS catalog view of the federated database global catalog.
When you write a CREATE NICKNAME statement, you specify a data source object that the nickname represents. In most cases, the federated server defines a database supported data type for each column or field in that data source object. For some non-relational data sources, you must supply the database data type.
For relational data sources, to determine which local data type to store in the SYSCAT.COLUMNS catalog view, the federated server looks for forward data type mapping information in the wrappers and in the SYSCAT.TYPEMAPPINGS catalog view. Mappings in the SYSCAT.TYPEMAPPINGS catalog view take precedence over the default mappings in the wrappers. If you create alternative mappings to override the default data type mappings, the federated server uses the alternative mappings. If multiple mappings apply to a column, the federated server uses the most recently created mappings.
For non-relational data sources, to determine which local data type to store in the SYSCAT.COLUMNS catalog view, the federated server looks for data type mapping information in the wrappers. Depending on the non-relational data source, the degree to which you can modify the data types defined by the wrapper varies. For some non-relational data sources, you do not specify any columns. The wrapper defines the data types. For other data sources you can override the data types. And for other data sources, you must specify the column data types on the CREATE NICKNAME statement.
When you write CREATE TABLE transparent DDL for relational data sources, specify database data types in the statement. The federated server checks for information about the reverse data type mappings between the federated database and the data source. The federated server looks for this information in the wrapper and the SYSCAT.TYPEMAPPINGS catalog view.
When values from a data source column are returned to the federated database, the values conform fully to the database data type that the data source column is mapped to. If this mapping is a default mapping, the values also conform fully to the data source type in the mapping. For example, if an Oracle table with a FLOAT column is defined to the federated database, the default mapping of Oracle FLOAT to data type DOUBLE automatically applies to that column. The values that are returned from the column conform fully to both the FLOAT and DOUBLE data types.