Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Indexing unique
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00180757
Message ID:
00180872
Vues:
22
Not seeing it in BROWSE (and other commands) doesn't mean it's not in the index. If SET DELETED is ON, you won't see it after you delete it. But it's still in the table, and still in the index, unless/until you PACK.

>When I started out, I thought I understood unique indexes. Now I'm really confused. Good thing I don't use them, eh? All I know is that if you set the order to the unique index and browse, you won't see John Smith listed, even if there are 50 John Smiths in the table, if you have deleted the 51st John Smith that was the one the index was using as the representative on the John Smiths.
>
>-Michelle
>
>>Um, only if you pack, or have FOR NOT DELETED(), right? Deleting a record doesn't remove it from the index, any more than it removes it from the table, unless you pack. Just thought that should be mentioned.
>>
>>>I think the thing with uniqe indexes is that if you delete the record that is in the index, it won't automatically stick another it.
>>>
>>>For example: Indexed on custname uniquely. There are 5 John Smiths. You delete the John Smith that is the one in the index. There is no longer a John Smith in the index, even though there are 4 others in the table. If you reindex, you pick up one of the others.
>>>
>>>-Michelle
>>>
>>>
>>>>OK, now I'm totally confused. After re-reading the docs it appears that if you have a record with a key value of A, change it to B, then add a new record with key value A it won't appear in the index. However, a quick test doesn't bear this out. It seems like there is always one record in the index per key value without reindexing.
>>>>
>>>>Anyone?
>>>>
>>>>>I don't think you made a mistake. IMO, what Help says actually means non-maintained (at least from common sense point :).
>>>>>
>>>>>>Oops, my mistake. I think that's a leftover piece of information from FP 2.0 or maybe even FoxBase+.
>>>>>>
>>>>>>>I disagree with your statement "Unique indexes aren't maintained." From the help:
>>>>>>>
>>>>>>>When a UNIQUE index or index tag is active and a duplicate record is changed in a manner that changes its index key, the index or index tag is updated. However, the next duplicate record with the original index key cannot be accessed or displayed until you reindex the file using REINDEX.
Rich Addison, Micro Vane, Inc., Kalamazoo, MI
Relax, don't worry, have a homebrew.
- Charlie Papazian, The New Complete Joy of Home Brewing
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform