Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Scan or Select, then scan
Message
 
À
28/01/2002 10:57:56
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00611587
Message ID:
00611948
Vues:
27
Also consider, if you have an index on Ref
SELECT Table
IF SEEK(lcRef)
   SCAN WHILE Ref = lcRef
      ...
   ENDSCAN
ENDIF
Will be a lot quicker then SCAN FOR, but of course assumes you have an index so you can SEEK()



>Hi
>
>Can anyone tell me if there is much difference here.
>
>Example 1:
>
>
SELECT Table
>SCAN FOR Ref = lcRef
>     lnRecNo = RECNO()
>     SCATTER MEMVAR
>     m.Ref = lcNewRef
>     INSERT INTO Table FROM MEMVAR
>     GO lnRecNo
>ENDSCAN
>
>
>Example 2:
>
>
SELECT *;
>  FROM Table;
> WHERE Ref = lcRef;
>  INTO CURSOR Updates
>
>SELECT Updates
>SCAN
>     SCATTER MEMVAR
>     m.Ref = lcNewRef
>     INSERT INTO Table FROM MEMVAR
>ENDSCAN
>
>
>The reason I'm asking is because "Table" is going to grow rapidly when live and this will be accessed on a Server.
>
>What I'm trying to avoid is all the record hopping in the 1st example, but I may be wrong in my 2nd solution, could someone let me know if there's much difference.
>
>Thanks
>Kev
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform