1) convert the argument to the correct type (as you did)
2) write another UDF that performs the same task with the same name that accepts the other argument.
DB2 does a "signature" search for executing functions. This means that the names AND the argument type must match for a function to work. This also allows for overloading a function (more than one function with the same name but different arguments). This is how option 2 works.