This example takes variable input arguments based on input from a previous correlated subquery in the FROM clause of a SELECT request, that is not shown. The function definition inputs XML text, which it then parses to extract a customer ID, store number, and the set of items purchased. The output produces one row per item purchased, with the columns being based on existing columns in the table defined in the function definition.
CREATE FUNCTION xml_extract( xml_text VARCHAR(64000)) RETURNS TABLE (cust_id INTEGER, store INTEGER, item INTEGER) LANGUAGE C NO SQL EXTERNAL;