Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is it possible to speed this loop and/or SQL up?
Message
De
18/03/2005 12:14:05
 
 
À
18/03/2005 11:06:02
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
00997258
Message ID:
00997323
Vues:
10
Hilmar

:-(

Elation turns to deflation. I don't understand. Everything worked fine. I'd commented out the bad code and done the good, like I copied to you (see below). And it worked great. Then I went back and got rid of the old code and ran it again. It's now taking JUST AS LONG and is reporting EVERY record.

Can you see anything wrong with the code below?

Thanks

Terry
Select RZSTOP
Set Order To RGDSNum   && RTE_NO + RTE_LET + DIRECTN + STR(SEQNO,4) + STR(NUMBER,3)
Select * From RZStop ;
	where RZStop.SeqNo = 1 ;
	and	  EMPTY( RZStop.Time) ;
	into CURSOR csrSubjRZStop ;
	Order by Rte_No, Rte_Let, Directn, Number
lnNoRecs		= _TALLY

Select csrSubjRZStop 
lnInterval		= INT( lnNoRecs / 100)
If lnInterval < 1
	lnInterval	= 1
EndIf 
lnDone			= 0
Thisform.barProgressBar.Reset( lnNoRecs)
Thisform.barProgressBar.Visible = .T.

SCAN
  lcRteNo 	= PADR( RTE_NO, 6)
  lcDirectn	= DIRECTN
  lcSeqNo  	= STR( SEQNO, 4)
  lcNumber	= STR( NUMBER, 3)
  lcStopNo	= PADR( STOP, 8)
  lcCounty	= PADR( COUNTY, 2)

  Select DISTINCT TIME from	RZStop ;
    where 	PADR( RZStop.RTE_NO, 6)    = lcRteNo ;
 	  and   RZStop.RTE_LET		= "A" ;
 	  and 	RZStop.DIRECTN		= lcDirectn ;
 	  and	STR( RZStop.SeqNo, 4)	= lcSeqNo ;
	  and	STR( RZStop.Number, 3)	= lcNumber ; 
	  and	PADR( RZStop.Stop, 8)	= lcStopNo ;
	  and	PADR( RZStop.County, 2)	= lcCounty ;
 	  and	not EMPTY( RZStop.TIME) ;
    to SCREEN NOCONSOLE	
  If _TALLY = 0			&& no hits on this stop # - i.e. all Time values empty
       ...
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform