Consultor Eletrônico



Kbase P30396: How to sort the RowObject dataset after it has been retrieve
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   2/17/2004
Status: Unverified

GOAL:

How to sort the RowObject dataset after it has been retrieved.

GOAL:

How to filter the RowObject dataset after it has been retrieved.

FACT(s) (Environment):

Progress 9.1x

FIX:

The SmartDataObject does not currently provide any functions for filtering or sorting the RowObject dataset, however, it can be accomplished by getting the handle of the RowObject query through the DataHandle property.

Example Code Snippet:

hDataHandle = DYNAMIC-FUNCTION(' getDataHandle' IN h_SDO).
IF DYNAMIC-FUNCTION('getLastRowNum' IN h_SDO) EQ ? THEN
RUN fetchLast IN h_SDO.
cPrepare = hDataHandle:PREPARE-STRING.
iBy = INDEX(cPrepare, ' BY ').
IF iBy NE 0 THEN
cPrepare = SUBSTR(cPrepare, 1, iBy).
lReturn = hDataHandle:QUERY-PREPARE(cPrepare +' BY ' + Sort-Field:SCREEN-VALUE) NO-ERROR.
IF lReturn THEN hDataHandle:QUERY-OPEN().
ELSE MESSAGE "Sort clause was not valid.".
END.
END.