Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Speeding up code-scan,update (follow-up from last Thursd
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows 2000 SP4
Database:
Visual FoxPro
Divers
Thread ID:
01340003
Message ID:
01340023
Vues:
13
>Several problems here:
>1. You use this as a field in result set:
> ALLT(STR(MONTH(DATE)))+ALLT(STR(YEAR(DATE))
>What if the first month of that result set is 1? then the whole field length will be 5 and at the end you can end with 12200 (Dec 200X). PAD it:
> PADL(ALLT(STR(MONTH(DATE)))+ALLT(STR(YEAR(DATE)),6,[0])
>
>2. use INNER JOIN instead of old WHERE. That makes code more readable:
>3. Do not use ALLTRIM() or EMPTY() in WHERE clause because there are not optimizable.
>4. I wonder HOW GROUP BY works if you didn't include in it the 3th selected field, but I suspect you have SET ENGINEBEHAVIUOR 70.
> Don't use this, you will get unexpected results from your queries.
>
>
>So lets go to SCAN ... ENDSCAN part:
>You never change the record pointer of C7 cursor so you ALWAYS update sCur with the same values over and over agein (depends how many records sCur has)

I thought sCur is a pseudonym for the c7. Otherwise good catch! I'm wondering why Beth didn't notice?
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform