CREATE OR REPLACE FUNCTION getSalaryByName(emp_name EMPLOYEES2.ename%type)
	RETURN EMPLOYEES2.salary%type
IS
	current_salary EMPLOYEES2.salary%type;

BEGIN
	SELECT E.salary INTO current_salary
	FROM EMPLOYEES2 E
	WHERE E.ename=emp_name;
	RETURN current_salary;

EXCEPTION
	WHEN TOO_MANY_ROWS THEN
	RETURN -1;

END;
/
