Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Replacing all value when an index is present
Message
 
 
To
27/04/2003 23:02:40
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00782080
Message ID:
00782096
Views:
16
>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--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform