skip to main content
SQL Engine Parse Tree API : SQL Engine Parse Tree functions reference : damex_describeSelectTopClause
 

damex_describeSelectTopClause

This function returns details of the TOP N clauses for a SELECT query. The TOP clause indicates the maximum number of rows to be returned.
Example queries:
SELECT TOP 10 * FROM emp;
SELECT TOP 5 PERCENT * FROM emp;
int damex_describeSelectTopClause(
    DAM_HQUERY hquery,
    int64 * piNumRows,
    int * pbPercent)
Table 196. Parameters for damex_describeSelectTopClause
Parameter
Type
Description
IN
hquery
DAM_HQUERY
The query handle.
OUT
piNumRows
int64 *
The number of rows in the TOP clause. This number should be treated as a PERCENT if value of pbPercent is returned as TRUE.
pbPercent
int *
Indicates if TOP N number was specified with PERCENT option. Valid value are:
*TRUE
*FALSE
RETURN
int
DAM_SUCCESS - on success
DAM_FAILURE - on failure