Caché MultiValue Basic Reference
SELECTINDEX
[Home] [Back] [Next]
InterSystems: The power behind what matters   
Class Reference   
Search:    

Selects an index.
Synopsis
SELECTINDEX indexname[,akey] FROM filevar TO varname
Arguments
indexname The name of a defined index, specified as a quoted string.
akey Optional — A specific index key value, specified as a quoted string.
filevar A local variable name assigned to the index file by the OPENINDEX statement.
varname A named select list for an index, created by SELECTINDEX. varname is specified as a variable name.
Description
The SELECTINDEX statement is used to select the unique keys of an index for use by the READNEXT statement. The index must already have been opened using the OPENINDEX statement.
There are three ways to select an index
Example
OPENINDEX 'VOC','F1' TO idxfp
SELECTINDEX 'F1' FROM idxfp TO idxlist
FOR x=1 TO 5
  READNEXT id FROM idxlist
  PRINT id
NEXT
See Also