Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cast() is evaluated for every record
Message
 
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro Beta
Miscellaneous
Thread ID:
00940524
Message ID:
00940803
Views:
13
>Mark,
>
>>Which bug?
>
>The performance issue of calling cast() for every row. There are some situations where a single call could correctly type/size the result column, but there are others where it doesn't. So a call on every row is needed. Perhaps cast() will be sped up so that the performance hit is not so severe.

The same could be said for

SELECT TRIM(LastName) + [, ] + FirstName as CustName

where the column width is defined by the first selected record. If you do not PADR() to make sure the width is sufficient, then you run the risk of undersizing your column. Same risk with using CAST() indiscriminately without specifing width/precision. I hope the final "version" of CAST() is used on the first selected record then cast aside for the rest of the records. < g >
Mark McCasland
Midlothian, TX USA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform