Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
String to long to fit - limit on aggregate functions ?
Message
From
21/07/2007 17:29:02
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
String to long to fit - limit on aggregate functions ?
Miscellaneous
Thread ID:
01242567
Message ID:
01242567
Views:
66
Okay, I'm stumped. A collegue send me a prg which evidently works for him but when I run it ( 2gb duo core XP sp2 VFP9 sp1 ) after it blows through some pretty complex ( and very long ) SQL statements it hits this one and blows out on a "String too long to fit" error


*= Create a summary cursor for each coverage.
SELECT ;
Pol_cKey ;
,MAX(Pol_cPolicyNo) AS Pol_cPolicyNo ;
,MAX(Pol_cFileNo) AS Pol_cFileNo ;
,MAX(Pol_cQuoteNum) AS Pol_cQuoteNum ;
,MAX(Pol_dBound) AS Pol_dBound ;
,MAX(Pol_nDues) AS Pol_nDues ;
,MAX(Pol_nCommRate) AS Pol_nCommRate ;
,MAX(Pol_nMaxRateMod) AS Pol_nMaxRateMod ;
,MAX(Pol_nDiscountMaxRateOverage) AS Pol_nDiscountMaxRateOverage ;
,MAX(Pol_nPremium) AS Pol_nPremium ;
,MAX(Pol_nMinPrem) AS Pol_nMinPrem ;
,MAX(Pol_nPremiumTax) AS Pol_nPremiumTax ;
,MAX(Pol_nPerilPrem) AS Pol_nPerilPrem ;
,MAX(Pol_nMinCharge) AS Pol_nMinCharge ;
,MAX(Pol_nMinChgDef) AS Pol_nMinChgDef ;
,MAX(Pol_nPolicyFee) AS Pol_nPolicyFee ;
,MAX(Pol_nPolicyFeeTax) AS Pol_nPolicyFeeTax ;
,MAX(Pol_ntfDecimal) AS Pol_ntfDecimal ;
,MAX(Pol_nMinTermFactor) AS Pol_nMinTermFactor ;
,End_cKey ;
,MAX(End_cQuoteNum) AS End_cQuoteNum ;
,MAX(End_dQuoteDate) AS End_dQuoteDate ;
,MAX(End_dBound) AS End_dBound ;
,MAX(End_dDate) AS End_dDate ;
,MAX(End_EffectiveDate) AS End_EffectiveDate ;
,MAX(End_EffectiveTime) AS End_EffectiveTime ;
,MAX(End_tEffectiveDateTime) AS End_tEffectiveDateTime ;
,MAX(End_ntfDecimal) AS End_ntfDecimal ;
,CAST(MAX(ALLTRIM(End_mScript)) AS Memo) AS End_mScript ;
,Cov_cKey ;
,MAX(Coverage) AS Coverage ;
,MAX(Cov_nMaxRateMod) AS Cov_nMaxRateMod ;
,MAX(Cov_nDiscountMaxRateOverage) AS Cov_nDiscountMaxRateOverage ;
,MAX(Cov_Discount) AS Cov_Discount ;
,MAX(CovDisc_nIsPolicyDiscount) AS CovDisc_nIsPolicyDiscount ;
,MAX(CovDisc_nDiscount) AS CovDisc_nDiscount ;
,MAX(CovDisc_nRateModPer) AS CovDisc_nRateModPer ;
,MAX(CovDisc_nRateModAmt) AS CovDisc_nRateModAmt ;
,MAX(Cov_TotCovPerPrem) AS Cov_TotCovPerPrem ;
,MAX(Cov_PerMinChgDef) AS Cov_PerMinChgDef ;
,CAST(MAX(ALLTRIM(Cov_ExtraCostPerils)) AS Memo) AS Cov_ExtraCostPerils ;
,MAX(Cov_TotCovHazDis) AS Cov_TotCovHazDis ;
,CAST(MAX(ALLTRIM(Cov_HazardDiscountsApplied)) AS Memo) AS Cov_HazardDiscountsApplied ;
,CAST(NULL AS Memo) AS HazardList ;
,CAST(MAX(LEN(ALLTRIM(Hazard))) AS INTEGER) AS MaxHazardLen ;
,CAST(MAX(LEN(ALLTRIM(ChildHazard))) AS INTEGER) AS MaxChildHazardLen ;
,SUM(PremiumB4Discounts) ;
AS TotalPremiumB4Discounts ;
,SUM(PremiumB4Discounts) ;
- SUM(EffectivePremium) ;
AS TotalHazardDiscounts ;
,SUM(EffectivePremium) ;
AS TotalHazardPremium ;
INTO CURSOR PolEndCovSummary ;
FROM DetailPolEndCovHazDiscountedPremiums ;
GROUP BY ;
Pol_cKey ;
,End_cKey ;
,Cov_cKey ;
ORDER BY 31 ; && Coverage
READWRITE


Enginebehavior is set to 70. I left the order of the INTO and FROM clauses just as he has it ( though I didn't know you could do that - looks like LINQ ) though I have tried switching them with the same result.

If I reduce the agg functions by about half it works.

Would very much appreciate any thoughts. ( I'll be talking with him Sunday, but have every reason to believe this runs for him )

TIA


Charles Hankey

Though a good deal is too strange to be believed, nothing is too strange to have happened.
- Thomas Hardy

Half the harm that is done in this world is due to people who want to feel important. They don't mean to do harm-- but the harm does not interest them. Or they do not see it, or they justify it because they are absorbed in the endless struggle to think well of themselves.

-- T. S. Eliot
Democracy is two wolves and a sheep voting on what to have for lunch.
Liberty is a well-armed sheep contesting the vote.
- Ben Franklin

Pardon him, Theodotus. He is a barbarian, and thinks that the customs of his tribe and island are the laws of nature.
Next
Reply
Map
View

Click here to load this message in the networking platform