If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Unanswered: SQL UDF VarChar Return

Hello All,

I work on IBM i (or whatever IBM likes to call it) platform and have created UDFs that return varchar. However, when I execute the UDF, it returns value with length as defined and not the actual length of the return value.

I have tried trimming before return but doesn't help. Any help?

Ex: I have my own "Extract" UDF which analyzes the string and gives me back the information that interests me. These are usually 10 characters long but my return definition is varchar(32). Instead of returning 10 byte value, the UDF returns 10 byte+blank padded value.