Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SCAN and query result
Message
 
 
À
31/07/2001 14:03:51
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:
00537911
Vues:
25
This message has been marked as a message which has helped to the initial question of the thread.
In this case just reverse reletationship
SELECT KeyField from AnotherTable Into Cursor KeyCursor
INDEX ON KeyField TAG KeyField
SELECT Mytable
SET RELATION TO KeyField INTO KeyCursor
SCAN FOR FOUND("KeyCursor")
   ...
ENDSCAN
>This looks promising. However, what would you do if several records in MyTable match KeyField? Would you recommend SET SKIP, or expand the SELECT to include a subquery (and get all PKs of table MyTable)?
>
>Hilmar.
>
>>
SELECT KeyField from AnotherTable Into Cursor KeyCursor
>>SET RELATION TO KeyField INTO Mytable
>>SCAN
>>   ...
>>ENDSCAN
>>
>>>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.
>>>
>>>TIA, Hilmar.
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform