Progress
SQL-89
Guide and Reference


Creating Indexes

The CREATE INDEX statement creates an index on one or more columns. The CREATE INDEX statement has the following syntax.

SYNTAX
CREATE [ UNIQUE ] INDEX index-name 
  ON table-name ( column [ , column ] ) 

The following example creates a unique index on the order-num and order-line columns of the order-line table.

CREATE UNIQUE INDEX po
  ON Order_Line (Order_Num, Line_Num). 

The UNIQUE option places a restriction on the column or columns of the index. The restriction requires that the values in the column or combination of columns are unique; no duplicate entries are allowed. In the preceding example, the keyword UNIQUE ensures that each set of order-num and line-num values are unique within the table.

The index name must also be unique within the database.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095