Try OpenEdge Now
skip to main content
DataServer for Oracle
Initial Programming Considerations : Database design issues : Index repositioning
 

Index repositioning

The DataServer supports index repositioning, which allows you to scroll through a query result set. You must define the query as SCROLLING and open the query with the INDEXED-REPOSITION option as the following syntax examples show:

Syntax

DEFINE QUERY query FOR buf-name SCROLLING.

Syntax

OPEN QUERY query FOR EACH record-phrase INDEXED REPOSITION.
The DataServer enforces the ordering of the query according to the index that the ABL compiler chooses when processing the query. If the index is not unique, the table that you query must have a unique record identifier so that the DataServer can ensure that duplicates order predictably. The record identifier that the DataServer uses is the same one that supports the OpenEdge ROWID function, that is, a PROGRESS_RECID column, the native ROWID, or a unique integer index. Performing an index reposition might cause the DataServer to issue a new query to Oracle. This new result set might contain rows that were added or changed since the original query was ordered. Note that by default, you can only scroll through the result set returned by the query. That is, you cannot scroll beyond the boundaries of the result set returned by the query. You cannot scroll through the rest of the database. If you wish to scroll outside the boundaries of the result set, you must add the -Dsrv srv-get-prev switch. This indicates to the DataServer, that it should generate new SQL to satisfy a GET PREV following a reposition which would have otherwise been outside the result set.