When to create function mappings

When a default function mapping is not available for a data source function, you can create a function mapping.

One reason that a function mapping is not available is that the federated database does not have a function that corresponds to the data source function.

Another reason a mapping is not available is that the data source has a similar function to a database function, but it does not return the same results. If the data source returns slightly different results or different results for certain sets of input data, the wrappers do not normally map to these functions. However, if you do not care about the differences in the result sets, then you can create a mapping between the functions. Creating a mapping might improve performance.

Use function mappings when:

  • A new built-in function becomes available at the data source
  • A new user-defined function becomes available at the data source
  • A database counterpart function does not exist
  • A counterpart function exists but returns slightly different results, which you do not care about

The settings for function mappings are stored in the SYSCAT.FUNCMAPPINGS catalog view.

When you create a function mapping, it is possible that the return values from a function evaluated at the data source will be different than the return values from a compatible function evaluated at the federated database. Federation component uses the function mapping, but it might result in an SQL syntax error or unexpected results.