Creating the dBASE complex index
To create a complex index for a dBASE table,
With the table open in the Table designer, choose Structure|Manage Indexes. The Manage Indexes dialog box appears.
Choose New in the Manage Indexes dialog box. The Define Index dialog box appears.
Select the combination of fields on which you want to index from the Available Fields list and move them to the Fields Of Index Key list. Or type a key expression, such as STATE+CITY, to create a complex index on the STATE and CITY fields. The key expression can use multiple field names, functions, and operators.
Click OK to exit the dialog box and save the index.
Key expressions
The following table shows several examples of key expressions and the fields used.
Key expression |
Fields used |
Notes |
CUSTOMER_N |
CUSTOMER_N |
|
CUSTOMER_N + ORDER_NO |
CUSTOMER_N, ORDER_NO |
|
CUSTOMER_N + DTOS(SALE_DATE) |
CUSTOMER_N, SALE_DATE |
DTOS converts date field to character for indexing. |
UPPER(LAST_NAME)+UPPER(FIRST_NAME) |
LAST_NAME, FIRST_NAME |
UPPER changes character field to all caps. |
The first example uses a single field as the key expression. Complex indexes, on the other hand, can use a combination of one or more fields, plus functions and operators.
CUSTOMER_N + ORDER_NO is a complex key expression using multiple fields and the concatenation operator (+).
CUSTOMER_N + DTOS(SALE_DATE) is a complex key expression consisting of multiple field names and a function.
UPPER(LAST_NAME)+UPPER(FIRST_NAME) converts characters to all caps before concatenating them. The UPPER function prevents sorting problems when capitalized entries are mixed in with lowercase ones.