SqlAltLen%

Returns the maximum length of the data in a compute column.

Syntax

SqlAltLen% ( sqlconn%, computeid%, column% )

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, which can have varying numbers of aggregate operators and aggregate targets. The computeid% is returned by SqlNextRow% or SqlGetRow%.
column%
Is the number of the column. The first column returned is number 1.

Returns

The maximum number of bytes that the data can be in a particular column in a COMPUTE clause. When no such column or COMPUTE clause exists, -1 is returned.

Remarks

Example

In the following example, SqlAltLen%(sqlconn%, 1, 1) returns 11 because COUNT is an int datatype, which is 11 bytes long:

select dept, name from employee
order by dept, name
compute count(name) by dept

See Also

SqlAData$, SqlADLen&, SqlAltType%, SqlGetRow%, SqlNextRow%, SqlNumAlts%