Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Select slows down when using (BUFFERING=.T.)
Message
 
 
À
26/05/2009 16:06:29
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01402021
Message ID:
01402066
Vues:
65
>>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform