Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Curious Spurious Filter in Cursor
Message
De
30/04/2004 08:29:17
Mike Yearwood
Toronto, Ontario, Canada
 
 
À
30/04/2004 07:34:33
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00899666
Message ID:
00899683
Vues:
15
Hi Terry

FoxPro tries to optimize queries by sometimes applying the equivalent of a SET FILTER instead of building the cursor. That's why the NOFILTER clause was added.

BTW, you may get a performance boost if you don't use the property nZone directly.

lnZone = .nZone
select ... and CENSUSZN.ZONE = m.lnZone

>Hello Gurus
>
>I'm selecting census data about human populations in various zones. I have the concept of zone groups, the zones in a County, those in a district, all zones, etc. I use SQL successfully to fetch the correct data.
>
>However, on the simplest of all, feching the data for an individual zone, as soon as I access my cursor, I get the error message:
>
>Variable "NZONE" is not found.
>
>Now, when I select a zone from a combo, I set the form's numeric prop .nZone to its key. Then I select the data via:
>
>
>      Select * from mclMPFAC!CENSUSZN ;
>        Where CENSUSZN.VAR_ID 	= 0 ;
>        and	  CENSUSZN.ZONE 	= .nZone ;
>      	Into Cursor csrCensusZn
>
>
>CENSUSZN is a collection of population fields, each rec with a Zone # and a variant # (VAR_ID) - Simple!
>
>I use the same cursor name for all the more complicated selects and no problem. But after creating the cursor in this case, I halted the prog and saw, in debug, that a filter had been created, thus:
>
>ZONE.AND.=NZONE
>
>No wonder I get the above err mess. But why!?
>
>None existed before and the filter doesn't occur in ANY of the other cases. I've put in a "Set Filt to" command to enable me to get at the data but the cursor features ALL zones, not just the one row for the selected zone.
>
>Can anyone help, please?
>
>TIA
>
>Terry
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform