Use the CREATE FUNCTION or CREATE
AGGREGATE FUNCTION statements to create user-defined functions.
You must have Resource authority to execute this statement.
Declaring a scalar user-defined function in Sybase Central
Sybase IQ supports simple scalar UDFs that can be used anywhere the SQRT function can be used. These scalar UDFs can be deterministic, which means that for a given set of argument values the function always returns the same result value. Sybase IQ also supports nondeterministic scalar functions, which means that the same arguments can return different results.
Declaring a user-defined aggregate function in Sybase Central
Sybase IQ supports user-defined aggregate functions (UDAFs). The SUM function is an example of a built-in aggregate function. A simple aggregate function takes a set of argument values and produces a single result value from that set of inputs. User-defined aggregate functions can be written that can be used anywhere the SUM aggregate can be used.