A database function does not contain a RETURN statement, which means that it cannot return a result. This is not allowed.
Add a RETURN statement to the database function.