RetrieveRow event
Description
Occurs after a row has been retrieved.
PowerBuilder event information
Event ID: pbm_dwnretrieverow
Argument |
Description |
---|---|
row |
Long by value. The number of the row |
Web ActiveX event information
Event name: onRetrieveRow
Argument |
Description |
---|---|
Row |
Number. The number of the row that was |
Return Values
Set the return code to affect the outcome of the event:
-
0 Continue processing
-
1 Stop the retrieval
For information on setting the return code in a particular
environment, see “About return values for
DataWindow events”.
Usage
If you want to guard against potentially large queries, you
can have code in the RetrieveRow event check the row argument and
decide whether the user has reached a maximum limit. When row exceeds
the limit, you can return 1 to abort the retrieval (in which case
the retrieval cannot be resumed).
A script in the RetrieveRow event (even a comment) can significantly
increase the time it takes to complete a query.
Obsolete methods in PowerBuilder
Instead of calling SetActionCode, use the RETURN statement
with a return code instead.
Examples
This code for the RetrieveRow event aborts the retrieval
after 250 rows have been retrieved.
1 |
IF ll_row > 250 THEN |
1 |
MessageBox("Retrieval Halted", & |
1 |
"You have retrieved 250 rows, the allowed & |
1 |
maximum.") |
1 |
RETURN 1 |
1 |
ELSE |
1 |
RETURN 0 |
1 |
END IF |