1. Write an external function that returns more than one value to the caller.
2. Register the function with the OUT keyword to indicate that the function returns extra values.
3. Create a Statement Local Variable (SLV) to use the OUT parameter when you invoke the external function in an SQL expression.
#
Registering an Iterator Function By default, an external function is not an iterator. To define an iterator function, you must register the function with the ITERATOR modifier. The following sample CREATE FUNCTION statement shows how to register the function TopK as an iterator function: