Register an iterator function

By default, a function written in an external language is not an iterator. To define an iterator function written in C or Java™, you must register the function with the ITERATOR routine modifier. The following sample CREATE FUNCTION statement shows how to register the function TopK() as an iterator function in C:
CREATE FUNCTION TopK(INTEGER, INTEGER)
   RETURNS INTEGER
   WITH (ITERATOR, NOT VARIANT)
   EXTERNAL NAME
      '/usr/lib/extend/misc/topkterms.so(topk_integers)'
   LANGUAGE C
Tip: An SPL iterator function does not need to be registered using the ITERATOR modifier.