I need to index a table whose index key is 200 characters long, and to allow duplicates.
What commands should I use to create the table and its cdx file?
OPEN DATABASE c:\foxahorro\ahorro.DBC
Use ahorro!peps2019 exclusive
Index on nombre tag yourtag
SET INDEX TO c:\foxahorro\peps2019 TAG yourtag
REINDEX
BROWSE
There are only 4 récords in the file at present, the field nombre has values of d, b, a and d
the browse command shows them in the same order, ie not indexed
[tt]INDEX ON nombre TAG yourtag[/tt] does create a tag "yourtag" inside peps2019.cdx (or however the table is named) and not a peps2019.idx file.
And you don't activate that index with SET INDEX To some file, that is the command to use with IDX indexes.
Once you created an index tag in the CDX you either [tt]USE ahorro!peps201 ORDER TAG yourtag[/tt] or you [tt]SET ORDER TO TAG yourtag[/tt] after you opened and selected the DBF or to switch between index tags.
You shouldn't use IDX index files for normal use, as these indexes only update together with DBF/FPT file changes when they are actively set, CDX files get updated even if you don't SET ORDER.
You may have a problem with 200 char field, as index TAGS are limited to 240 bytes, which in any collation but MACHINE is only 120 double-byte characters. But indexing in MACHINE collation is recommended to make the most use of indexes for Rushmore anyway, especially as that's the collation to use for any non-character data type anyway.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.