Primary and secondary indexes
dBASE Plus lets you create primary and secondary indexes for any table type that supports them.
A primary index is the main index in a table. For DBF tables, only level 7 tables support primary indexes; any expression index may be created as the primary index. For all other table types, the primary index consists of one or more consecutive fields, starting with the first field in the table.
A secondary index is supplemental to the primary index in a table.
Some table types let you specify whether or not a secondary index is case-sensitive. Case sensitivity affects the sort order and the uniqueness of values. In dBASE Plus, you can create case-sensitive indexes only, although dBASE Plus maintains case-insensitive indexes when you edit tables that use them.
Each table should have one primary index, although it is not required. In a Paradox table, the primary index is stored in a file with a .PX extension.
Unique keys
Primary indexes require unique values—they do not permit duplicate key values. For example, if a dBASE table has a primary index on ORDER_NO, you cannot add two orders with the same order number—only one can exist in the table. In a composite index, individual field values can be duplicates, but the combined value of all key fields must be unique. (Secondary indexes do permit duplicate values.)
When you create the primary index, use a field that will contain a unique value for each row, such as a customer number field.
A table can have only one blank (empty) value in the keyed field, because subsequent blank values are considered duplicates. Therefore, key fields usually require entries.
Note
Some field types, such as memo, OLE, binary, and logical, are unavailable as key fields.
Secondary indexes, maintained and non-maintained
The dBASE Level 7 and Paradox table types permit two types of secondary indexes:
Maintained secondary indexes are automatically maintained when data changes in the table. dBASE Plus lets you create maintained secondary indexes, and it updates maintained indexes automatically when you edit a table.
Non-maintained secondary indexes are not automatically updated when the table is open. dBASE Plus does not let you create non-maintained secondary indexes, but it supports any existing non-maintained indexes.
The dBASE table format lets you create maintained secondary indexes regardless of whether the table has a primary index. You can create as many single-field (simple) indexes as there are fields in a table, and you can create up to 255 multiple-field (called complex or composite) indexes per table.