Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Replacing all value when an index is present
Message
 
 
À
27/04/2003 23:02:40
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00782080
Message ID:
00782096
Vues:
15
>When you scan a table and you replace a specific field, when that field is part of an index, it is extremely slow as oppose to not having an index. I understand there might be complex routines being executed on the back. But, for something that I do a lot of times, it would be extremely useful if the product would be able to deal with that in a more powerful way. Any comment?

Hi Michel,

It's bad idea to do that for a different reason. When you update field in the current index, the records is moved in that index so the next record may not be the one that was before update. As result you may miss some records in your SCAN loop. In such cases I ususly use following technique.
SELECT filed1, field2, field3, RECNO() AS RecordNo ;
   FROM mytable ;
   ORDER BY filed1, field2, field3 ;
   INTO CURSOR crsSorted
SET ORDER TO IN mytable
SET RELATION TO RecordNo INTO mytable
SCAN
...
ENDSCAN
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform