Index repositioning
- Last Updated: January 17, 2024
- 2 minute read
- OpenEdge
- Version 12.8
- Documentation
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
|
Syntax
|
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.Note: Indexed
repositioning is not supported in the following scenarios:
- When there is a join query.
- When the index is not present in the table.
- When the table does not contain a unique row ID or an index that uniquely identifies a table row.