Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is it possible to speed this loop and/or SQL up?
Message
From
21/03/2005 09:37:52
 
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00997258
Message ID:
00997806
Views:
11
My point is that the where clause must match the index epression EXACTLY. Try to divide the select into two selects, and make the first select statement select as few records as possible, something like this:
lnSEQNO=SEQNO && You must change this!!
Select * from RZStop where;
 RTE_NO + RTE_LET + DIRECTN + STR(SEQNO,4) + STR(NUMBER,3)=lcRteNo + "A" + lcDirectn + STR(lnSEQNO,4) + STR(lnNumber,3) into cursor dummy nofilter
Select DISTINCT TIME from dummy ;
 where ALLTRIM( RZStop.RTE_NO)  == lcRteNo ;
 and RZStop.RTE_LET	       == "A" ;
 and RZStop.DIRECTN	       == lcDirectn ;
 and	 ALLTRIM( RZStop.Stop)   == lcStopNo ;
 and	 ALLTRIM( RZStop.County) == lcCounty ;
 and	 RZStop.Number	       == lnNumber ; 
 and not EMPTY( RZStop.TIME) ;
 to SCREEN NOCONSOLE
>Tore
>
>>What is the index expression for your table?
>
>Not sure what you mean by that but the order is:
>
>Set Order To RGDSNum && RTE_NO + RTE_LET + DIRECTN + STR(SEQNO,4) + STR(NUMBER,3)
>
>Terry
Previous
Reply
Map
View

Click here to load this message in the networking platform