Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Select slows down when using (BUFFERING=.T.)
Message
 
 
To
26/05/2009 16:06:29
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01402021
Message ID:
01402066
Views:
67
>>I have a SQL statement in a form method that I call from the AfterRowColChange() event of my input grid (see code below). The purpose it total the line item prices as the user is adding rows to the grid.
>>
>>Lparameters tiQuoteNo
>>*--------------------------------------------------------------------------
>>* Calculates the total quoted price all line items on the Quote.
>>* Stores the result into thisform.nSummaryQuoteTotal property
>>*--------------------------------------------------------------------------
>>
>> Select Sum(qty*price);
>> From Quote With (BUFFERING = .t.);
>> Where Quote.quote_no=tiQuoteNo and Quote.print=.t.;
>> Into Array laQuoteTotal
>> 
>> thisform.nQuoteTotalPrice=Nvl(laQuoteTotal, 0)
>> 
>> Return thisform.nQuoteTotalPrice
>>
>
>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.

Exactly.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform