WebFOCUS: Number of Rows Returned

In some cases, you may want to know the number of rows returned when you HOLD a TABLE. After your END statement in your block, you can use &LINES. For Example

TABLE FILE CAR
PRINT
CAR
ON TABLE HOLD AS CARS_LIST
END
-*show the number of rows returned in the console

-TYPE ‘Rows Returned’ &LINES

-* jump to a different block of code if no rows returned

IF &LINES EQ 0 THEN GOTO :HANDLE_NO_DATA;

If you’re looking to get the number of rows as part of the hold file, then you can do something like this:

TABLE FILE CAR
PRINT
COMPUTE ROW_COUNT/I4 = ROW_COUNT+1; NOPRINT
CAR
ON TABLE SUBFOOT

“Total Rows: <TOT.ROW_COUNT”

END

One thought on “WebFOCUS: Number of Rows Returned

Leave a Reply

Your email address will not be published. Required fields are marked *

Current day month ye@r *