Use the USE-INDEX phrase to force a retrieval order
- Last Updated: December 18, 2023
- 1 minute read
- OpenEdge
- Version 13.0
- Documentation
If you look at all the indexes for the Order table in the
Data Dictionary, you can see that there is also an index called
OrderDate. You can select the index to use when the default choice is not
the one you want. ABL does this by adding a USE-INDEX phrase
to the record phrase. This form of the FOR EACH statement is
guaranteed to return the earliest OrderDate, even if it is not the lowest
OrderNum:
|
The result in the following figure shows that there is indeed an earlier
Order for the first of your Customers that does not have
the lowest OrderNum.