The database server uses the following steps to find the support functions:
init_func (dt_agg, dt_setup)
The return type of the INIT function establishes a state type that the database server uses to resolve the other support functions. If the INIT function is omitted, the state type is the data type of the argument of the aggregate.
iter_func (state_type, dt_agg)
The return type of the ITER function should be the state type.
comb_func (state_type, state_type)
The return type of the COMBINE function should be the state type.
final_func (state_type)
The return type of the user-defined aggregate is the return type of the FINAL function. If the FINAL function is not specified, the return type is the state type.
The preceding steps use the following variables.
Aggregate states should never be null. That is, the support functions should not return a null value. The database server cannot distinguish a null value from the result of aggregating over an empty table. Therefore, although null values do not cause runtime errors, the COMBINE function and the FINAL function ignore them.
Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]