MvSETINDEX#
Opens the index files specified in INDEXES for an already open database with NAME alias. If the NAME attribute is omitted, the index files are opened for the primary database.
<MvSETINDEX NAME = "string: { expression } | literal"
INDEXES = "{ expression } | filename list">
The first comma-separated file listed becomes the main index for the database. <MvSETINDEX>
closes any currently open index files for this database alias before opening the specified index files. After opening, the record pointer moves to the first record in the database (in indexed order).
<MvOPEN>
and <MvMAKEINDEX>
will also open listed index files for the specified or primary database.
Attributes#
Attribute | Description |
---|---|
NAME |
Optional Database alias. When a database is opened with <MvOPEN> , it is referenced in all other database commands by the alias. If omitted, the index is opened for the primary database. The database must be open. |
INDEXES |
Required. Contains a single index or comma-separated list of index files that will be opened and associated with the database. Any other opened indexes associated with the NAME database will be closed first. |
Examples#
<MvSETINDEX NAME="employees" INDEXFILE="/myfiles/emp_salary.mvx">
In this example the expression in INDEXFILE
results in the comma-separated string "/myfiles/emp_salary.mvx, /myfiles/emp_names.mvx"
. Both indexes will be opened. The first becomes the main index. Both will be updated when the database is altered.
<MvASSIGN NAME="l.path" VALUE="/myfiles/">
<MvSETINDEX NAME="employees" INDEXFILE="{ l.path $ 'emp_salary.mvx, ' $ l.path $ 'emp_names.mvx' }">