Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Null values in cursor
Message
 
 
To
27/04/2007 14:36:52
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 6 SP5
Miscellaneous
Thread ID:
01220061
Message ID:
01220517
Views:
18
>>>Sergey's solution is much simpler. Thanks anyway.
>>>
>>It is for the particular case. But I'm not 100% sure it's the correct one.
>>
>>How would the SQL determine the width of the column for UDF? With the suggested solution it leaves a room for ambiguity.
>
>Either the UDF must itself ensure a fixed width (padr() for character data), or the SQL expression must do something similar. In my case, my function already ensured a fixed width.
>
>>Also what if UDF returns values of different types?
>
>I usually avoid this kind of design, but in that case, an iif() would have to be used in the SQL expression.

That' good you put the precautions in place. If UDF would mess up, I'm not sure how SQL would work. Most probably it will return syntax error.

Anyway, I showed a generic solution for the field types which can not be easily constructed in SQL.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform