Declaring and Defining Aggregate UDFs

SAP Sybase IQ supports aggregate UDFs. The SUM function is an example of a built-in aggregate function. A simple aggregate function produces a single result value from a set of argument values. You can write aggregate UDFs that can be used anywhere the SUM aggregate can be used.

Note: The aggregate UDF examples referenced here are installed with the server, and can be found as .cxx files in $IQDIR16/samples/udf. You can also find them in the $IQDIR16/lib64/libudfex dynamically linkable library.

An aggregate function can produce either a single result, or a set of results. The number of data points in the output result set may not necessarily match the number of data points in the input set. Multiple-output aggregate UDFs must use a temporary output file to hold the results.