Index cursors
- Last Updated: October 14, 2024
- 1 minute read
- OpenEdge
- Version 12.8
- Documentation
To understand better how the AVM navigates through a set of data, you need to understand the concept of index cursors. When you retrieve a record from the database using any of the statements you saw in this section, the AVM keeps track of the current record position using an index cursor—a pointer to the record, using the location in the database indexes of the key value used for retrieval.
When you execute the statement FIND FIRST
Customer, for example, the AVM sets a pointer to the record for the first customer
within the CustNum index. If you execute the statement FIND FIRST Customer WHERE Country = "USA", the AVM points to
Customer 3430 through the CountryPost index.
When you execute another FIND statement on
the same table using one of the directional keywords, the AVM can go off in any direction from
the current index cursor location, depending on the nature of the statement. By default, it
reverts to the primary index. Here is an example that extends the previous one slightly:
|