Equinox Online Help - Language Reference - A to Z

Home

CopyIndex

Applies to
SyntaxCopyIndex TargetQueryIndex [,SourceIndex, LowerExpression, UpperExpression, HowExpression, ChangeCount]
Action[Statement] Copies all or part of an existing index into a query index.
ScopeUsable anywhere
Notes

This statement makes a copy of part or all of the index specified by the SourceIndex parameter. If SourceIndex is omitted the current index is copied. The destination index name is supplied in TargetQueryIndex. A partial copy of an index can be made by supplying the optional values LowerExpression and UpperExpression to specify the first and last values to copy. The optional parameter HowExpression indicates what to do with existing index entries. The possible values are:

  • 0 Delete all existing index entries (the default)
  • 1 Add the source values to the existing index entries
  • 2 Remove the source values from the index

ChangeCount returns the number of entries either added to or deleted from the target index.

Both TargetQueryIndex and SourceIndex (if specified) should be in the home table.

You are not able to use CopyIndex to copy from a child index to a global query index.

CopyIndex does not support related field indexes.

The system workarea SysError is set to a non-zero value if an error occurs, otherwise zero. Use of this statement can substantially improve the speed of some database operations.

CategoryIndexes
See Also BlankIndex, CurrentIndex, GroupSetIndex, IndexFromName, IndexLastUsed, IsDuplicate, KeyValues, MakeKey, ModifyIndex, NameFromIndex, SetExecuteIndex, SetIndex, UnmarkIndex, UpdateIndex
Example

This example copies all names between Smith and Jones from the xSurname index and adds them to the qNameIdx query index.

CopyIndex qNameIdx, xSurname, "Smith", "Jones", 1