Use a USE-INDEX phrase to force index selection
- Last Updated: January 16, 2024
- 1 minute read
- OpenEdge
- Version 12.8
- Documentation
You can also force a retrieval sequence with the USE-INDEX phrase. For instance, if you want to find the next set of
Customers based on the Customer name, you can use the
Name index, which contains just that one field:
|
The output shown in the following figure confirms that the AVM is walking
through the records in Name order, starting with the
name of the first Customer in the USA.
This technique can be very valuable in expressing your business logic in your procedures. You might need to identify a record based on one characteristic and then retrieve all other records (or perhaps just one additional record) based on some other characteristic of the record you first retrieved. This is one of the most powerful ways in which ABL lets you define your business logic without the overhead and cumbersome syntax required to deal with all data access in terms of sets.