Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SCAN and query result
Message
De
31/07/2001 14:01:47
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00537855
Message ID:
00537904
Vues:
15
I'll think about it. Thank you. Actually, I was dreaming of something more similar to a subquery. After I posted the question, I started thinking, and I now believe an actual subquery is possible: just call a function (or method) from the subquery, and do all the processing there. The method can even return a logical value (processing successful), so the actual query result is useful: show all records that could NOT be processed for some reason. But I still have to do some thinking, whether this approach will actually simplify my code or not.

I was actually thinking myself about using SEEK(). However. the sample SELECT - SQL, in the subquery, is only a sample - the actual selection of records I need to do is more complex. Therefore, I actually think I will try the subquery approach.

Hilmar.

>>I want to process, in a SCAN loop, all records that satisfy a given condition. The condition is most easily expressed as a SELECT - SQL - but what is the best way to combine the two?
>>
>>
>>Pseudocode:
>>
>>SCAN where KeyField in (SELECT KeyField from AnotherTable)
>>   ...
>>ENDSCAN
>>
>>
>>The processing itself is too complicated to place into a single INSERT - SQL command.
>>
>>Basic criteria: 1) code should not be too messy, 2) it should be reasonably fast.
>
>How about:
>
>
>SCAN
>  IF SEEK()
>  etc
>
>
>or if you can do it, faster would be:
>
>
>SCAN
>  IF INDEXSEEK()
>  etc
>
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform