Registering the custom function for the script

You must register the script custom function WSSCRIPT.ARGS before you register the script wrapper.

About this task

You must register the custom function on each federated database instance where the script wrapper is installed.

The custom function for the script wrapper must be registered with the schema name WSSCRIPT.

You must include specific keywords when you register the custom function for the script wrapper. Include the AS TEMPLATE, DETERMINISTIC, and NO EXTERNAL ACTION keywords in the CREATE FUNCTION statement.

The federated environment uses two query engines. For the script wrapper, these query engines are the federated database query engine and the script wrapper query engine. You can specify that predicates get pushed down to the script wrapper engine by using the script wrapper custom functions in the WHERE clause of your SELECT statement.

The create_function_mappings.ddl file in the sqllib/samples/lifesci/script directory on the federated server specifies the data types for the custom function.

Procedure

Run the create_function_mappings.ddl file on each federated database instance where the script wrapper is installed.

Results

The following example shows the syntax for the WSSCRIPT.ARGS function:
CREATE FUNCTION WSSCRIPT.ARGS (input_column_data_type(), input_column_data_type())
    RETURNS INTEGER AS TEMPLATE
    DETERMINISTIC NO EXTERNAL ACTION;