advr.hlp (Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
CREATEINDEX Statement Details
  ◄Summary►  ◄Details►  ◄Example►                ◄Contents►  ◄Index►  ◄Back►
──────────────────────────────────────────────────────────────────────────────
 CREATEINDEX [#]filenumber%,indexname$,unique%,columnname$[,columnname$]
 
 Usage Notes
   ■ When you initially open a table, the current index is the NULL index.
     The NULL index represents the order in which records were added to the
     file.
 
   ■ Once an index has been created, it can be used any number of times until
     it is deleted from the database.
 
   ■ DELETE, INSERT, and UPDATE operations affect all indexes in a table.
     Each of these operations automatically updates all indexes. INSERT or
     UPDATE will fail if the operation produces a nonunique index value in
     any index defined as unique-only. DELETE, INSERT, and UPDATE operations
     are not affected by SETINDEX.
     See: ◄DELETE Statement►    ◄INSERT Statement►
          ◄SETINDEX Statement►  ◄UPDATE Statement►
 
   ■ Use SETINDEX to make an index the current index and to impose its order
     on the presentation of records in a table.
 
   ■ The maximum number of indexes per table is 28.
 
   ■ Columns that are arrays, user-defined types, or strings longer than 255
     characters cannot be indexed.
 
   ■ The argument indexname$ is the name of the index until the index is
     explicitly deleted.
 
   ■ A nonzero value for the argument unique% indicates the index is unique;
     no two indexed values can be the same.
 
   ■ A value of zero for unique% means the indexed values need not be unique.
 
   ■ If more than one columnname$ is given, CREATEINDEX defines an index
     based on the combination of their values.
 
   ■ The argument columnname$ must appear in the corresponding TYPE statement
     used when the table was created.