>>>>Anyway, I showed a generic solution for the field types which can not be easily constructed in SQL.
>>>
>>>I think the generic solution will work for different field lengths (padr() would still be simpler), but the UNION will fail if you mix different field types.
>>
>>It sure will.
>>
>>If you want to have an integer field in your resulting cursor, how would you do it assuming your UDF returns 1,2,3?
>
>Oh, that. OK, in this case you are right. I thought you meant that one and the same function could have different return types. I guess I misunderstood.
No, you didn't misunderstand. I was just thinking aloud about various things simultaneously. Of course, it's a bit confusing <g>
If it's not broken, fix it until it is.
My Blog