Dynamic return type generation in a database system. A request is received
to execute a first function. A second function is executed if the first
function is defined to return data in a first type of data structure.
When executed, the second function returns formatting information that
indicates an arrangement of fields of data within the first type of data
structure. The first function is executed to obtain a collection of data
formatted according to the first type of data structure, and the
collection of data is organized according to the formatting information
returned by the second function.