dbnumalts

DB Library for C

DB Library for C

dbnumalts

Returns the number of columns in a compute row.

Syntax

INT dbnumalts (
PDBPROCESS
dbproc,
INT
computeid );

Arguments

dbproc

Is the DBPROCESS structure that is the handle for a particular workstation or Microsoft® SQL Server™ 2000 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.

Examples

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

dbgetrow

dbadlen

dbnextrow

dbaltlen

dbresults

dbalttype