Extending a built-in aggregate

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:

  1. Develop support functions to overload the required operators.
  2. Register each function with a CREATE FUNCTION statement.

    For more information, refer to Registering a user-defined routine.

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 IBM® 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 IBM Informix DataBlade API Programmer's Guide or the IBM J/Foundation Developer's Guide.


Copyright© 2018 HCL Technologies Limited