-20019 THE RESULT TYPE RETURNED FROM THE FUNCTION BODY CANNOT BE ASSIGNED TO THE DATA TYPE DEFINED IN THE RETURNS CLAUSE
Explanation
The data type of the value returned by the function body must be assignable to the parameter specified in the RETURNS clause.
System action
The statement cannot be processed.
Programmer response
Change the RETURNS type or change the expression in the RETURN statement so that the result type of the expression returned from the function body can be made.
SQLSTATE
42866