dbnumorders

DB Library for C

DB Library for C

dbnumorders

Returns the number of columns specified in a Transact-SQL SELECT statement's ORDER BY clause.

Syntax

INT dbnumorders ( PDBPROCESS dbproc );

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.

Returns

The number of ORDER BY columns. If there is no ORDER BY clause, dbnumorders returns 0. If there is an error, dbnumorders returns -1.

Remarks

After a SELECT statement has been executed and dbresults has been called to process it, you can call dbnumorders to find out how many columns were specified in the current statement's ORDER BY clause. Call dbnumorders after dbresults has returned SUCCEED.

See Also

dbordercol

dbresults