Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
FPD25 SELECT and UDF and Multiple DBFs
Message
 
To
12/12/2001 10:55:15
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00593262
Message ID:
00594255
Views:
28
Thanks Hilmar for your suggesstions

>>Dear All,
>>
>>I am writing a SELECT statement. I have to use multiple UDFs in it as there are a lot of complicated calcuations going on in it and the return value from the UDF is to be used as the value for the SELECT.
>>
>>1) Should I, WHERE join the required DBFs and in the UDF straight away use the current record in the respective DBFs for calculations?
>>
>>2) Should I, not join those DBFs (not required except for the calc anyway) and do SEEK() for the required DBFs in the UDFs
>>
>>Please Help
>>
>>Thanks in advance.
>
>One thing to consider is that if your UDF returns a character expression, it better be a fixed length. Otherwise, VFP or FoxPro will automatically use the length for the first record for all others, I think; and your data will end up too short. Use padr() to ensure the fixed length.
>
These are numeric fields but even they have thier length probs.

>For efficiency, if possible, first select all other data, then apply the UDF to the result. That way, you avoid evaluating records you don't need anyway.

I will keep that in mind but as this query is complex I want to reduce the qty. of SELECT statements as much as possible.

>
>HTH, Hilmar.
Regards
Bhavbhuti
___________________________________________
Softwares for Indian Businesses at:
http://venussoftop.tripod.com
___________________________________________
venussoftop@gmail.com
___________________________________________
Previous
Reply
Map
View

Click here to load this message in the networking platform