If you created a user-defined aggregate with the Aggregate wizard, BladeSmith generates aggregate methods in the ProjectUDRs.java source code file.
BladeSmith only generates templates for aggregate methods.
The generated method declares the method, its return type, and arguments.
To complete the code for aggregate methods, you must:
For more information on programming aggregate methods, see IBM Informix: J/Foundation Developer's Guide.
If you selected an initialization method, AggregateInit(), you must add code to it to initialize the state type required by the aggregate computation. The AggregateInit() method returns the state type.
The first argument of the AggregateInit() method is a dummy argument whose value is always NULL. The second argument is an optional initialization parameter to customize aggregate computation. The initialization parameter cannot be a lone host variable reference.
You must add code to the iteration method, AggregateIter(), to perform the aggregate computations.
If you selected a combine method, AggregateComb(), you must add code to it to merge one partial result with another and return the updated state type.
If you selected a final method, AggregateFinl(), you must add code to convert the state type to the result type.
You can also add code to the AggregateFinl() method to release resources acquired by the initialization method. However, the AggregateFinl() method must not free the state type.
Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]