Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Which command would execute faster? Seek & Do while or S
Message
De
28/03/2006 21:04:30
Mike Yearwood
Toronto, Ontario, Canada
 
 
À
28/03/2006 20:53:46
Sonny Tabano
Trams Printwork, Inc.
Mabalacat, Philippines
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01108228
Message ID:
01108654
Vues:
13
>Hi Rich,
>
>Thanks for the advice. Cust_ID is a character ("0008") not 8. What I wanted to do is to go directly to the records for Cust_ID="0008" and sum all the orderamount (as indexed on Cust_ID) and immediately stop summing the orderamount when it encounter the next record not equal to "0008" (Cust_ID). I wanted to completely avoid all those Cust_ID<>"0008".
>
>Since Sum .... for ... Cust_ID="0008" would still go though all of the records and would take some time somehow so does with using SQL thats why I thought of the seek and do while. I've used the "&" because the input would be coming from the user of his/her choice of Cust_ID. (Dont know if this is a good idea or not).
>

It's not! If you have a character variable lcVar and it contains "00008" when you ?&lcVar. you will get the numeric value 8. Not only that, it's much slower to use &.

Doing it with cust_id = m.lcVar will work much faster so long as the cust_id in the table matches the data type of the m.lcVar.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform