Maintain indexes through ABL
- Last Updated: March 30, 2020
- 2 minute read
- OpenEdge
- Version 12.2
- Documentation
As you work with your application, you will want to know when the AVM creates and updates indexes. The AVM creates a new index entry for a record at the first occurrence of any one of the following:
- At the end of a statement in which the AVM assigns values to all components of the index entry.
- At the end of the closest iterating subtransaction block in which the AVM creates the record.
- When the AVM processes a
VALIDATEstatement. - When the AVM releases the record from the record buffer.
- At the end of the transaction in which the AVM creates the record.
The AVM updates an index at the end of any statement in
which it changes the values for one or more index fields. Because
the AVM updates indexes immediately (at the end of an UPDATE statement), the
AVM immediately FINDs records in the order of the new
index, while the data in the found record is unchanged. The AVM
changes the data in the record at the end of the scope of the record
or when it releases the record.
You can change the name of an index at any time. You can also delete nonprimary indexes. However, before letting you delete a primary index, OpenEdge requires that you first designate another index as primary.
If there is only one index, you must create a new index before deleting the existing index. You cannot change any of the component definitions of an index. Instead, you must delete the index and re-create it using the modified component definitions.
Remember that OpenEdge assumes that the first index you create is the primary index, so create your primary index first.