Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Speeding up code-scan,update (follow-up from last Thursday)
Message
De
19/08/2008 13:01:43
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Speeding up code-scan,update (follow-up from last Thursday)
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows 2000 SP4
Database:
Visual FoxPro
Divers
Thread ID:
01340003
Message ID:
01340003
Vues:
60
Hi all,

Follow-up from last Thursday's thread# 1338981

this is one scan endscan that I have in my program ( I inherited it, working on cleaning it up. :D)
SELECT srvceid, COUNT(DATE) AS wrksrvceDate , ALLT(STR(MONTH(DATE)))+ALLT(STR(YEAR(DATE))), ;
  C1, C4 ;
  FROM cost, cstcoef ;
  WHERE cost.costcoef == cstcoef.coefid AND ;
  (RIGHT("00"+ALLT(STR(MONTH(DATE))),2)+ALLT(STR(YEAR(DATE)))=ALLTR(sPeriod) ;
  AND NOT EMPTY(dateappr) AND ALLT(STATUS)=='' AND NOT schoolclose AND NOT Cancelled) ;
  GROUP BY srvceid, C1, C4 ;
  INTO CURSOR c7

SELECT (sCur)
GO TOP
SCAN
  SELECT (sCur)
  UPDATE BL731 SET BL731.wrksrvceDate=c7.wrksrvceDate ;
    WHERE srvceid=c7.srvceid AND C1 = c7.C1 AND C4 = c7.C4
ENDSCAN
USE IN c7
Rich suggested that I use index and replace all. My problem with indexes is that srvceid is a character field and c1 and c4 are numeric. How would I make a index for a character and numerical index without causing problems for the data?

TIA
Beth
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform