There are several types of user-defined functions.
-
Scalar or aggregate – the UDF operates either on a single value (scalar) or multiple values (aggregate). Aggregate UDFs are also sometimes known as UDAs or UDAFs. The context structure for coding aggregate UDFs is slightly different than the context structure used for coding scalar UDFs.
-
Deterministic or non deterministic – the result of a function can be determined either solely by the input parameters and data (deterministic), or by some random behavior (non-deterministic). Parameters of non-deterministic UDFs typically need a random seed as one of the input parameters.
-
Aggregate UDFs only) single output or Multiple outputs – 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. In Sybase IQ 15.1, multiple-output aggregate UDFs must use a temporary output file to hold the results. In future versions, you may be able to implement aggregate functions that return multiple results packaged in a large binary object (BLOB).