SqlNumAlts%

Returns the number of columns in a COMPUTE clause row.

Syntax

SqlNumAlts% ( sqlconn%, computeid% )

where

sqlconn%
Is a SQL Server connection. The value of sqlconn% is returned by SqlOpen%.
computeid%
Is the COMPUTE clause. A SELECT statement can have multiple COMPUTE clauses, each of which can have a different number of aggregate operators and aggregate targets. The computeid% is returned by SqlNextRow% or SqlGetRow%.

Returns

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

Remarks

Call this function after SqlResults% returns SUCCEED.

Example

In the following example, SqlNumAlts%(sqlconn%, 1) returns 3:

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

See Also

SqlAData$, SqlADLen&, SqlAltLen%, SqlAltType%, SqlGetRow%, SqlNextRow%, SqlResults%