ProvideX V8.20 > Language Reference > 2. Directives
102
DROP INDEX Directive
            Drop Key from Keyed File
Format
DROP INDEX {keynumber | keyname$} FROM filename$ [,ERR=stmtref]
Where:
filename$
Name of the file from which the key will be dropped. String
expression.
FROM
Mandatory keyword, not case-sensitive.
keyname$
Name of the key to drop (if assigned). String expression.
keynumber
Key number (KNO value) to drop.
stmtref
Program line number or label to transfer control to.
Description
The DROP INDEX directive drops keys from a ProvideX Keyed file without having to
rebuild the file. When dropping keys from a file:
· The key is removed from the data file and the space previously occupied by the
key table is made available for subsequent use within the file.
· Only one drop can be processed against a file at one time.
· Exclusive access to the file is required.
· The primary key is required and cannot be dropped.
See also
ADD INDEX Add Key to Keyed File, p.29
RENAME..INDEX Rename Keys in Keyed File, p.283
Example
DROP INDEX 3 FROM "cstfile"
DROP INDEX CustName FROM "cstfile"