15 The Btrieve (Pervasive.SQL) Driver : Create and Drop Index Statements

Create and Drop Index Statements
The Btrieve driver supports SQL statements to create and delete indexes.
Create Index
The Create Index statement for Btrieve files has the form:
CREATE [UNIQUE] INDEX index_name ON table_name ([field_name [ASC | DESC] [,field_name
[ASC | DESC]]...)
Unique means that Btrieve does not let you insert two records with the same index values.
index_name is the name of the index.
table_name is the name of the table on which the index is to be created.
ASC tells Btrieve to create the index in ascending order. DESC tells Btrieve to create the index in descending order. By default, indexes are created in ascending order. For example:
CREATE INDEX lname ON emp (last_name)
Drop Index
The form of the Drop Index statement is:
DROP INDEX table_name.index_name
table_name is the name of the table from which the index is to be dropped.
index_name is the name of the index.
For example:
DROP INDEX emp.lname