Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Select slows down when using (BUFFERING=.T.)
Message
From
27/05/2009 00:04:51
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
26/05/2009 23:19:55
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01402021
Message ID:
01402163
Views:
52
>>Why are you using SQL to do this? You've already got all the data at hand, just save the record pointer, SUM() and restore it.
>
>This works nicely. And, it DOES work with buffered records. Many thanks.
>
>It moves the pointer around, which my SQL did not, but that's ok. I store and restore pointer, as you suggested.
>
>What do you think about this:

Alias() is not a safe thing, it will bang in the end if you had nothing in the current workarea. Also, you don't even have to keep the record number... just open your cursor again:
Lparameters tiQuoteNo

lnSelect=Select()

Select 0
use dbf("Quote") again alias (sys(2015))
Sum (qty*price);
 For quote_no=tiQuoteNo And Print=.T.;
 To Thisform.nQuoteTotalPrice
use

Select (lnSelect)

Return Thisform.nQuoteTotalPrice

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform