Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SELECT SQL Problem?
Message
From
29/07/1997 20:36:40
 
 
To
29/07/1997 08:25:37
Matt Mc Donnell
Mc Donnell Software Consulting
Boston, Massachusetts, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00042085
Message ID:
00042222
Views:
25
Thanks Vinod, your suggestion works......


>>Hi all
>>
>>When I do a SELECT SQL, can I use a function to do calculation and return to a cursor? Example: SELECT cnoee, dmysum(yamt1+yamt2+...) from dpayrslt. If yes, how does the SQL knows what type and how many decimal it should create for the second field?
>>
>>Actually I have done the above and the second field it returns currency which I wants. When I change the SQL to SELECT dpayrslt.cnoee,demas.cname,dmysum(yamt1+yamt2+....) from demas,dpayrslt where demas.cnoee=dpayrslt.cnoee, the second field becomes numeric 1? Why and how I overcome this?
>>
>>Thanks in advance.
>
>
>Question 1) Yes, you can use UDFs in SQL SELECTs, but if the function changes work areas, your select may return unpredictable results.
>
>Question 2) Foxpro assigns the type to the column based on the first row returned. Therefore, any result returned from the UDF should be padded to the maximum width to ensure the proper format is used. If using a numeric with decimals, make sure that set decicals is on and set to the number that you wish to use, at least within the function.
>
>HTH
>
>Matt
Previous
Reply
Map
View

Click here to load this message in the networking platform