Returns the type of aggregate function for a compute column.
INT dbaltop (
PDBPROCESS dbproc,
INT computeid,
INT column );
The type of aggregate operator for the particular column in the compute. The types are defined as follows:
Type | Aggregate operator |
---|---|
SQLAOPSUM | SUM |
SQLAOPAVG | AVG |
SQLAOPCNT | COUNT |
SQLAOPMIN | MIN |
SQLAOPMAX | MAX |
Call dbaltop only after dbnextrow or dbgetrow returns a computeid.
If computeid or column is not valid, -1 is returned.
After the following SELECT statement, calling dbaltop(dbproc, 1, 1) returns the type for COUNT because the first aggregate operator in the first COMPUTE clause is COUNT:
SELECT dept, name FROM employee
ORDER BY dept, name
COMPUTE COUNT(name) BY dept
To convert the type to a readable string, use dbprtype.
dbadata | dbnextrow |
dbadlen | dbnumalts |
dbaltlen | dbprtype |
dbgetrow |