A function must return a value when
you select from the same. You have to check whether the function PLSQL code
whether it is going for any exception and it is not returning any values at the
end. At least a null value “return null” will fix the issue.