Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL & UDF Weird Runtime Behavior
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00031218
Message ID:
00031250
Views:
43
>Running VFP 3.0b
>
>I am creating an SQL Select statement that contains a UDF that passes the field name (the UDF essentially gets the first letter of each word in the field).
>
>The problem is that this works correctly in Development mode, but in the exe I am getting the whole text from the field. And, it looks as though the function is not getting called at all.
>
>i.e. SELECT GetLetter(PersonName) FROM .......
>
>FUNCTION GetLetter()
>PARAMETER jcField
>..
>..
>RETURN lcResult

Usually, is not a good practice to assume ANYTHING about table status/environment in a SQL SELECT. (e.g. don't call UDFs that are referencing a table unless there is no other way).

Try to pass the value of the field to your UDF instead of the field name. It should work fine.

Vlad
Previous
Reply
Map
View

Click here to load this message in the networking platform