INDEX command

Used to create an index for an ACL table that allows direct access to the records in a sequential rather than a physical order.

Syntax

INDEX <ON> key_field <...n> <D> TO file_name <IF test> <WHILE test>
<FIRST|NEXT range> <OPEN> <ISOLOCALE locale_code>

Parameters

ON key_field

Specifies the field(s) to index on.

D

Optional. Specifies that key fields should be sorted in descending order. The default sort order is ascending.

TO file_name

The name of the index. The index file is created with an .INX extension.

IF test

Optional. Specifies a condition that must be met. The command is only executed on records that pass the test.

WHILE test

Optional. Specifies that the command should only be executed while a condition is true. The command processing terminates as soon as the specified test evaluates as false, or the end of the table is reached.

FIRST | NEXT range

Optional. Specify FIRST to start processing at the first record or NEXT to start processing at the currently selected record. Use the range value to specify the number of records to process.

OPEN

Specifies that the table should be opened, and that the index should be applied to the table.

ISOLOCALE locale_code

Optional. This parameter is only available in the Unicode edition of ACL. Specifies the locale. If you do not specify a locale, ACL uses the default locale. Locale codes are based on the ISO 639 standard language codes and the ISO 3166 standard country codes. Enter locale_code in the format language code_country code. For example, enter the code fr_ca for Canadian French. If you do not specify a country, ACL uses the default country for the language.

Example

The following example opens the Vendor table, and creates an index on the “Vendor City” column, and applies the index to the table.

OPEN Vendor
INDEX ON Vendor_City to “CityIndex” OPEN
SET INDEX TO "City"
Related reference
SORT command


(C) 2013 ACL Services Ltd. All Rights Reserved. | Send feedback