Informix Error -9412
-9412 Return type of the support function <function-name> does not
match the aggregate state type.When you extend a built-in aggregate for a user-defined data type, the return type of the operator function must be the same as the data type for which you are extending the aggregate. For example, if you try to use the SUM aggregate on the "new_type" data type, thedatabase server looks for a plus() function with the following signature:
CREATE FUNCTION plus(c1 new_type, c2 new_type) RETURNING new_type;
This error can also occur for user-defined aggregates if the return type of an INIT support function is not the same as that of the ITER or COMBINE function. For user-defined types, make sure that the return types of the INIT function (if any), ITER function, and COMBINE function are the same as the user-defined type.