dbordercol

Description

Return the id of a column appearing in the most recently executed query’s order by clause.

Syntax

int dbordercol(dbproc, order)
 
DBPROCESS   *dbproc;
int                       order;

Parameters

dbproc

A pointer to the DBPROCESS structure that provides the connection for a particular front-end/server process. It contains all the information that DB-Library uses to manage communications and data between the front end and server.

order

The id that identifies the particular order by column of interest. The first column named within the order by clause is number 1.

Returns

The column id (based on the column’s position in the select list) for the column in the specified place in the order by clause. If the order is invalid, dbordercol returns -1.

Usage

This routine returns the id of the column that appears in a specified location within the order by clause of a SQL select command.

For example, in given the SQL statement, the call dbordercol(dbproc, 1) will return 3 since the first column named in the order by clause refers to the third column in the query’s select list:

select dept, name, salary from employee 
order by salary, name 

See also

DBNUMORDERS