Progress
Language Tutorial
for Windows


Defining Indexes

An index is a field or combination of fields from one table that Progress uses as the basis for searching, sorting, or otherwise processing the records of that table. As an example of index properties, access the property sheet for the Comments index of the Customer table as shown in Figure 4–6.

Figure 4–6: Index Properties Sheet

An index is defined by several important properties. First, the index must have a unique name. If it is a simple index, based on one field, then name the index the same as the field component. If it is a compound index, based on several fields, give the index a descriptive name that describes the components of the index.

Next, the properties of an index include each component field and whether the component is ascending or descending. The selection list on the properties sheet lists the component fields and their ascending or descending status. When a field component is ascending, Progress sorts the index values from first to last (for example, A to Z or 1 to 10). When a field component is descending, Progress sorts the index values from last to first (for example, Z to A or 10 to 1). Note that you cannot change these properties after you create the index. Changing components or sort direction is equivalent to building a new index.

Finally, an index has a series of logical properties that define how the index works. These properties are represented as toggle boxes on the property sheet. Table 4–4 describes these properties.

Table 4–4: Index Properties 
Property
Description
Primary
The primary index is the one that Progress uses by default. Each table has one and only one primary index. Progress uses the primary index when retrieving records or ordering records for a list (like a report) if you don’t specify another index. You want your primary index to reflect the most common or natural sort order.
Unique
A unique index is one where each index value must be different. For example, each customer needs a unique number to identify them. Thus, the Cust-Num index is a unique index. When you define an index as unique, Progress will not allow you to enter an index value that’s already in use.
Active
An active index is one that Progress updates when you create, delete, or modify a record. If the index were inactive, you could still find the definition of the index in the Data Dictionary, but Progress would not update it until you made it active again.
Word
A word index is one based on a character field where each distinct word in the data becomes a separate index entry. Word indexes allow you to search character fields quickly for key words.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095