Using the USE-INDEX phrase to force a retrieval order
- Last Updated: March 30, 2020
- 1 minute read
- OpenEdge
- Version 12.2
- 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 that uses the Order field.
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's 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 doesn't have the lowest OrderNum.
