Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
View definition has been changed
Message
 
 
To
30/10/2007 18:02:09
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01265020
Message ID:
01265299
Views:
12
Hi Bob,

VFP9 has CAST() function that allows easily handle field type conversation or desired type and size in a query.

>
>As mentioned earlier, the problem arose when I used different settings for a particular logical in subsequent requeries of the same view. Based on the setting of the logical, either an underlying numeric value (from a table) went to the view’s cursor, or a value of 0.00 was sent to the cursor by the view. This happened in the line:
>
>iif(OD.lChg4Add, OD.nCrest_Prc, 0.00) as nCrest_Chg
>
>
>As it turns out, Surgey had the right concept with his warning about “expressions that could return variable size strings”, as the problem was size (structure). It was Bruce’s approach; however, that pointed directly to the problem.
>
>I ran the view under the two different logical settings for OD.lChg4Add and saw that the structure for nCrest_Chg showed up either as [n 5,2] (which represented the structure of the underlying field OD.nCrest_Prc that was being read), or as [n 4,2] when the SQL provided the value of 0.00.
>
>The solution was the below:
>
>iif(OD.lChg4Add, OD.nCrest_Prc, 00.00) as nCrest_Chg
>
>where I replaced 0.00 with 00.00, which forced the view structure for nCrest_Chg to [n 5,4] ... matching the structure that came from the table.
>
>Thanks to all
>
>Bob
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform