Extending a built-in aggregate
About this task
When you extend a built-in aggregate to include a UDT, you do not use the CREATE AGGREGATE statement because the aggregate itself already exists.
To extend a built-in aggregate:
Procedure
- Develop support functions to overload the required operators.
- Register each function with a CREATE FUNCTION statement.
For more information, refer to Registering a user-defined routine.
Results
After you register the support functions that overload the binary operators, you can use the built-in aggregates in an SQL statement.
For the syntax of the CREATE FUNCTION statement, see the Informix® Guide to SQL: Syntax. For more information about how to write overloaded functions, refer to Routine overloading. For information about how to write functions in external languages, refer to the Informix® DataBlade® API Programmer's Guide or the J/Foundation Developer's Guide.