Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2014
    Posts
    1

    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.

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    How do you verify what you think is happening? For example, can you be sure it's not your client software that pads the return value with blanks? And what is the database software version?
    ---
    "It does not work" is not a valid problem statement.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •