Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Speeding up code-scan,update (follow-up from last Thursd
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows 2000 SP4
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01340003
Message ID:
01340024
Views:
11
>>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?

Even though,
Why Beth not get the values she wants directly in SELECT than update some fields lately?
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform