Stored Aggregate Functions
Stored Aggregate Functions allow users to create custom aggregate functions that process a sequence of rows and return a single summary result.
Standard Syntax
CREATE AGGREGATE FUNCTION function_name (parameters) RETURNS return_type
BEGIN
ALL types of declarations
DECLARE CONTINUE HANDLER FOR NOT FOUND RETURN return_val;
LOOP
FETCH GROUP NEXT ROW; // fetches next row FROM TABLE
other instructions
END LOOP;
ENDUsing SQL/PL
Examples
SQL/PL Example
See Also
Last updated
Was this helpful?

