I'll give this a shot...
VFP without the NOFILTER clause may (read: usually will) "return" a "filtered result set".
I put "return" in quotes because because it doesn't really "return" anything - it simply applies a filter against the original table.
This works fine when referring to the "result" cursor records directly (at least I think it does), BUT there are side-effects. RECCOUNT(), for instance, will return to total records in the origin table, NOT the number of records in the (alleged) cursor.
Its been so long since I had the problems that I don't remember, but siffice to say that NOFILTER was a long overdue "fix" (though in my opinion it was done backwards).
I believe that using the "result" cursor in a later SQL-Select causes it to lose the filtering, resulting in incorrect results.
Someone with a better memory for the details hopefully will give more concrete examples.
Cheers
>VFP 7 doc states the following
>
>
>"Include NOFILTER to create a cursor that can be used in subsequent queries. In previous versions of Visual FoxPro, it was necessary to include an extra constant or expression as a filter to create a cursor that could be used in subsequent queries. For example, adding a logical true as a filter expression created a query that could be used in subsequent queries:
>
>SELECT *, .T. FROM customers INTO CURSOR myquery
>Including NOFILTER can reduce query performance because a temporary table is created on disk. The temporary table is deleted from disk when the cursor is closed. "
>
>But it never seemed to be problem( at least in VFP6 ) and it is not a problem in VFP7 for
>
>SELECT * FROM customers INTO CURSOR myquery
>select * from myquery where cust_id = some_id into cursor myquery1
>
>What is meant by "subsequent query" then ?
>
>Thank you
>Michael
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement