|
<< Click to Display Table of Contents >> Paradox driver |
![]() ![]()
|
The Paradox driver supports both descending and unique secondary index types and default values ("NOW") for the time stamp and time fields.
Descending and unique secondary index types
You can use composite indexes where some fields are ascending and others are descending.
The descending and unique secondary index types share these characteristics :
•Both index types require Table Level 7.
•At table creation time the table level is automatically upgraded to level 7 if:
a) any of these index types are requested, and
b) no lower table level is specified as an optional parameter (DBIERR_TABLELEVEL).
•If adding the index to a table with a lower table level, the error returned is DBIERR_TABLELEVEL.
•DBIERR_TABLELEVEL error code replaces DBIERR_OLDVERSION whenever a higher table level is required.
•Both index types share the characteristics of "Composite secondary indexes." They require a unique index name and so on.
•The Descending and Unique options can be mixed with each other, as well as with the bMaintained, and bCaseInsensitive options.
•In case of duplicate fields, the indexes must be distinguished by at least one of these options:
bUnique
bCaseInsensitive
bDescending (not bMaintained)
| Note: | If two indexes are distinguished only by the bUnique option, they will in effect be equivalent, but is still accepted. |
Descending secondary indexes
The IDXDesc structure includes this boolean array :
BOOL16 abDescending[DBIMAXFLDSINKEY];
The abDescending array indicates which fields in a composite secondary index are descending (TRUE). Thus, in a composite key, if abDescending[i] is TRUE--where 'i' is the index to aiKeyFlds[]--then the aiKeyFld[i] is descending.
This array is ignored if:
•The existing boolean bDescending is FALSE.
•The index has only one field.
If you have an index with only one field, (and if and bDescending is TRUE), then you do not need to specify TRUE in abDescending[0]. In that case, bDescending counts for everything and abDescending is ignored. This rule is consistent with previous semantics (for dBASE and FoxPro descending indexes).
There are no other restrictions on how ascending and descending can be mixed. You may improve performance slightly if you do not specify a descending index.
Unique secondary indexes
The bUnique option enables the creation of unique secondary indexes.
•At table create time: upgrades the table to level 7.
•At add index time: requires the fields in the unique index to be unique already, otherwise it will fail. No error table is generated for the records that contain the non-unique field values.
•At restructure time: If the fields are not unique, restructure will fail, and will not generate an error table for records containing non-unique field values.
Valchecks
Valchecks are default values for TIME and TIMESTAMP. Similar to specifying "TODAYVAL" for a default value for a date field. You can specify 'NOW' for the default value for a TIME and TIMESTAMP field.
•This has an effect only at DbiInitRecord time, where the 'current' time or timestamp will be substituted.
•This feature is supported only for table level 7 or higher.
•At create table or restructure table time: if the table level is less than 6, the function will fail with DBIERR_TABLELEVEL.
•The table will NOT be automatically upgraded.
•For table level 7 tables, up to 255 VCHKDescs may be supplied at table create time. For lower table levels, the number is 64. If more are supplied, the function returns DBIERR_TABLELEVEL.
Record locks
The maximum number of record locks on a shared Paradox table is 255.