I have one row in my Company_Person_all view named by 'YENER UZUN' in EMPLOYEE_NAME column (I already want only one result). When I send parameter to this function (fname, instead of using 'YENER UZUN') I encounter
ORA-01422:exact fetch returns more than requested number of rows ...
What should I do to prevent this error? Also when I write the code below ('YENER UZUN', instead of fname) it's ok it doesn't give me an error.
FUNCTION Get_Calistigi_Santiye_By_Fname(fname IN varchar2)
RETURN varchar2
IS
temp_ varchar2(100);
BEGIN
select free_field6
into temp_
from company_person_all
where employee_name = 'YENER UZUN';
DBMS_OUTPUT.put_line(temp_);
RETURN temp_;
END;