next up previous contents
Next: Applications of SQL-AG Up: Online Version Previous: Generating Aggregate

Using the Created Procedure

In O-SQL-AG to support online aggregation, packages are used to store information persistently. Aggpackage contains the aggregate independent information and Aggregatename_package contains the aggregate dependent information. To use the created stored procedure in any PL/SQL code, user need to initialize aggpackage first using:

and need to call the following procedure once the aggregate is used.

Following is a simple call to the created aggregate.

The default usage of the aggregate is non-online. To use the aggregate as online, user has to set aggpackage.online to true. The variable aggpackage.eof_table is true if the whole table has been processed and the variable aggpackage.output_result is true if the function has returned a result. Variables aggregatename_package.gvariable_name contain the value of the partial result. (Here variable_name is the name of the variable used in defining the prototype of Output function). The variable aggpackage.supress is used to supress all the output on screen and aggpackage.debug is used to output extra debug information. Next chapter contains an example computing online average and an example using online aggregation in evaluating a sub-query.



Punit Bhargava
Wed Mar 11 18:50:53 PST 1998