dbnumalts

Returns the number of columns in a compute row.

Syntax

INT dbnumalts (
PDBPROCESS
dbproc,
INT
computeid );

where

dbproc
Is the DBPROCESS structure that is the handle for a particular workstation/ SQL Server process. It contains all the information that DB-Library uses to manage communications and data between the workstation and SQL Server.
computeid
Is the ID that identifies the COMPUTE clause. A SELECT statement can have multiple COMPUTE clauses, which can have varying numbers of aggregate operators and aggregate targets. The computeid is returned by dbnextrow or dbgetrow.

Returns

The number of columns for the particular computeid. If computeid is invalid,
- 1 is returned.

Remarks

Call this function after dbresults has returned SUCCEED.

Example

In this example, dbnumalts(dbproc, 1) returns 3:

select dept, year, sales from employee
order by dept, year
compute avg(sales), min(sales), max(sales) by dept

See Also

dbadata, dbadlen, dbaltlen, dbalttype, dbgetrow, dbnextrow, dbresults