Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Ghost file links
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00127796
Message ID:
00127839
Vues:
30
>I have a table within a large database which is behaving very strangely. When I run a simple SQL (even when the table has no records), _TALLY returns the correct number of records selected by the query. However, when I check for the number of records in the cursor, it matches that of the number of records in the original table, although I know that the figure returned by _TALLY is correct. The funny bit is this. When I try and do CDX(1, 'cCursor'), it returns the .CDX of the DBF itself! I have removed the table from the database, re-created it and the problem occurs again.
>
>If it is any help, I have done some fiddling and found that if the table has no CDX or IDX file (upon re-creating), it behaves perfectly OK. As soon as I add a CDX tag to the table, the error occurs again.
>
>The database (and its memo file) was packed, validated and re-compiled after removeing the offending table. The table and its CDX were deleted from the disk.
>
>Help anyone?

Sanjay,

This is not a problem it is by design. The query optimizer in Visual FoxPro realizes that the fastest way to your result is to use the dbf again and set a filter on it, so that is what it does. _TALLY is telling you how many records met your conditions and should be used to find out the number of result records.

If you absolutely don't want the filtered table view and you don't mind waiting for your results, you can use the NOFILTER option in your SELECT command to prevent the filtering.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform