DB2 SQL function overloading does not care about datatype length, and precision, for example
MYFUN(P DECIMAL) and MYFUN(P DECIMAL(6, 2) are conflicted definition; DB2 will not regard them as overloading, but an error.
If you want to define a SQL function supports different precision and scalar value DECIMAL data type, you can use DECFLOAT, like
CREATE FUNCTION MYFUNC(P DECFLOAT)
RETURNS VARCHAR(100)
LANGUAGE SQL
RETURN VARCHAR(P);
How to use:
myfunc(dec(1.2345, 5, 4))
or
myfunc(dec(1.2345, 10, 5))
or
myfunc(decfloat(dec(1.2345, 5, 4))