Data.DB.TIndexOption
Delphi
TIndexOption = (ixPrimary, ixUnique, ixDescending, ixCaseInsensitive,
ixExpression, ixNonMaintained);
C++
enum DECLSPEC_DENUM TIndexOption : unsigned char { ixPrimary, ixUnique, ixDescending, ixCaseInsensitive, ixExpression, ixNonMaintained };
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
enum | public | Data.DB.pas Data.DB.hpp |
Data.DB | Data.DB |
Description
TIndexOption describes the attributes of an index.
TIndexOption is a set of attributes that applies to a specific index. A TIndexOption value can include zero or more of the following values.
Value | Description |
---|---|
ixPrimary |
The index is the primary index of the table (not applicable to dBASE tables). |
ixUnique |
Each value in the index is unique; there are no duplicates (not applicable to all table types). |
ixDescending |
The index imposes a descending sort order (not applicable to all table types.) |
ixExpression |
The index is based on a dBASE key expression (only applicable to dBASE tables). |
ixCaseInsensitive |
The index sorts records case-insensitively (not applicable to all table types). |
ixNonMaintained |
The index is not automatically updated when the data is edited (not applicable to all table types). |
Note: Attempting to create an index using options that are not applicable to the table type causes AddIndex to raise an exception.
Not all table types support use of all of the above index options. Even within a particular table type, an option may only be supported in certain versions of a table type. See the Database Explorer utility for information on local table levels.
dBASE tables only support primary indexes and true unique indexes when the table level is 7 or higher (concurrent with Visual dBASE 7). dBASE tables do not support case-insensitive or descending indexes. Use the ixExpression constant when the index is based on multiple fields or uses dBASE data manipulation language functions (that is, for expression indexes). The ixExpression constant is only applicable to dBASE tables.
Paradox tables support the ixDescending for secondary indexes if the table level is 7 or higher and the ixUnique constant if the table level is 5 or higher. The ixDescending and ixCaseInsensitive constants are not applicable to primary indexes.
For SQL-based table types, see the vendor-supplied documentation for the particular database system for details on what index options are applicable.