RetrieveRow

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 that was just retrieved


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.

IF ll_row > 250 THEN
      MessageBox("Retrieval Halted", &
         "You have retrieved 250 rows, the allowed & 
         maximum.")
      RETURN 1
ELSE
      RETURN 0
END IF

See also

RetrieveEnd

RetrieveStart

SQLPreview

UpdateStart