Invoke an iterator function

You can invoke an iterator function using one of the following methods:
  • Directly with the EXECUTE FUNCTION statement:
    • From DB-Access
    • In a prepared cursor in an external routine
    • In an external routine
    • In an SPL FOREACH loop
  • With an EXECUTE FUNCTION statement as part of an INSERT statement:
    • From DB-Access
    • In a prepared cursor in Informix® ESQL/C or an external routine
    • In a DataBlade® API database server routine
    • In an SPL FOREACH loop
  • In the FROM clause of a SELECT statement

    Instead of a table, the result set of the iterator function is the source from which the query selects data. The return values from the iterator function are mapped to a virtual table. Using an iterator function in a FROM clause is described in detail, next.

    Existing iterator UDRs from pre-9.4 releases can be used in the FROM clause of a SELECT statement.