Returns the bylist for a compute row.
LPCBYTE dbbylist (
PDBPROCESS dbproc,
INT computeid,
LPINT size );
A pointer to an array of BYTES containing the numbers of the columns that compose the bylist for the specified compute. The names of the columns are available by calling dbcolname. If the computeid is out of range, NULL is returned.
The size of the array is returned in the size parameter. A size of 0 indicates that either this particular compute has no bylist or the computeid is out of range.
A SELECT statement’s COMPUTE clause can contain the keyword BY, followed by a list of columns. This list, known as the bylist, divides the results into subgroups based on changing values in the specified columns. The COMPUTE clause’s row aggregate is applied to each subgroup, generating a compute row for each subgroup.
Call this function after dbresults has returned SUCCEED.
Assume the following command has been executed:
SELECT dept, name, year, sales FROM employee
ORDER BY dept, name, year
COMPUTE COUNT(name) BY dept,name
The call dbbylist(dbproc, 1, &size) sets size to 2 because there are two items in the bylist. It returns a pointer to an array of 2 BYTES, which contain the values 1 and 2, indicating that the bylist is composed of columns 1 and 2 from the select list.
dbadata | dbcolname |
dbadlen | dbgetrow |
dbaltlen | dbnextrow |
dbalttype | dbresults |