Function templates

The federated server recognizes a data source function when there is a mapping between the data source function and a database counterpart function at the federated database.

You can create a function template to act as the database counterpart function when no counterpart exists.

A function template is a database function that you create for the purpose of forcing the federated server to invoke a data source function. However, unlike a regular function, a function template has no executable code. When the federated server receives queries that specify the function template, the federated server will invoke the data source function.

The function template is created with the CREATE FUNCTION statement using the AS TEMPLATE parameter.

After you create a function template, you must then create the function mapping between the template and the data source function. A function mapping is created using the CREATE FUNCTION MAPPING statement.