Oracle includes a pseudo-column called ROWNUM which allows you to generate a list of sequential numbers based on ordinal row. If your application uses the Oracle database, apply your Oracle skills and ROWNUM to limit the number of returned rows. For example, this query selects the 10 rows from a table:
SELECT * FROM (SELECT rownum r, t_dwstyle_grid_employ.empid FROM t_dwstyle_grid_employ) WHERE r BETWEEN 10 AND 20;
You can impose a NEXT button to the DataWindow. In the Clicked event of the NEXT button, the query changes with ROWNUM which increments by 10. Therefore, when the NEXT button is clicked, the DataWindow displays the next 10 rows.
If your application uses a non-Oracle database (for example, Microsoft SQL server) you can use the following SQL syntax to limit the number of returned rows to the DataWindow:
SELECT TOP 10 * FROM my_table WHERE Table.primary_key > = :bottom ORDER BY Table.primary_key;
Before retrieving the first page of data, "bottom" should be set to a value smaller than any primary key value in the table.
Based on this SQL statement, you can implement Next and Previous buttons for the DataWindow. Their Clicked events increment or decrement the "bottom" variable so that its value matches the primary key value in the first row you want to retrieve then execute the above SQL statement.