EasyTable: Single-File Embedded Database,
a BDE replacement for Delphi and C++Builder



CREATE INDEX Statement
Previous  Top  Next


Introduction

The CREATE INDEX statement is used to create new index in a table.

Syntax

CREATE [UNIQUE] INDEX index_name ON [MEMORY] table_name
(
field_name [ASC|DESC] [CASE|NOCASE]
[,field_name...]
[,Password 'text_pass' ]
)

Use CREATE INDEX to create index in a table. Indexes are used to increase search and sorting speed. Indexes decrease performance of inserting, updating and deleting data.

MEMORY option specifies that in-memory table will be created.
The UNIQUE option specifies restriction on inserting rows to a table with duplicate columns values. It means that all rows in a table have unique combination of index columns values.
The ASC option specifies ascending order, the DESC option specifies descending order. The default value is ASC.
The CASE option specifies case-sensitive index, the NOCASE specifies case-insensitive index. The default value is CASE.
The Password option is a password for encrypted table.

Here is an example:

CREATE UNIQUE INDEX Text_Index ON Test
(
Text DESC NOCASE
,ID
,Password '2'
)


© AidAim Software EasyTable: Easytable Single-file Embedded Database Bde Replacement Delphi C\+\+builde