Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cursors and Indexes
Message
De
31/03/2005 22:06:16
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01000464
Message ID:
01000507
Vues:
23
>>All indexes created on a cursor will be flushed with the cursor when it is closed.
>
>While in this particular scenario the above statement is true, it is misleading and just plain wrong in some cases if I'm not mistaken. On cursors, you can create a single index that does indeed get destroyed along with the cursor, but in order to add more indexes, you have to specify the file where you want to store them and that file does not get erased automatically. I don't recall there having been any change to that behavior, but I'm unable to test it here.

If you use the TAG clause - usually the recommended approach - all indices are stored in a single file. For instance, if your file is called client.dbf, all indices are stored in the file client.cdx, and referenced by tag name. In the case of a cursor, the CDX file is temporary; when the cursor is closed, both the DBF and the CDX files are automatically killed.

You can, indeed, also create separate index files. I am not sure whether these are killed together with the cursor, since I would probably never use them with a cursor.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform