Retrieving rows as needed
If your DataWindow object retrieves hundreds of rows, there can be
a noticeable delay during execution while all the rows are retrieved and
before control returns to the user. In these DataWindow objects, you can
have PowerBuilder retrieve only as many rows as it has to before displaying
data and returning control to the user.
For example, if your DataWindow object displays only 10 rows at a
time, it might make sense to have PowerBuilder retrieve only a small
number of rows before presenting the data. Then as the user pages through
the data, PowerBuilder continues to retrieve what is necessary to
display the new information. There may be slight pauses while PowerBuilder retrieves
the additional rows, but the pauses may be worth it if users do
not need to wait a long time to start working with data.
To specify that a DataWindow object retrieve only as
many rows as it needs to:
-
Select Rows>Retrieve Options>Rows
As Needed from the menu bar.With this setting, PowerBuilder presents data and returns control
to the user when it has retrieved enough rows to display in the DataWindow object.
Retrieve Rows As Needed is overridden if you have specified
sorting or have used aggregate functions, such as Avg and Sum, in
the DataWindow object. This is because PowerBuilder must retrieve every row
before it can sort or perform aggregates.
In a multiuser situation, Retrieve Rows As Needed might lock
other people from the tables.