Considering the following function : Which of the following code will work fine?
Considering the following function :
CREATE OR REPLACE FUNCTION get_avg_sal (p_dept_id number) RETURN number AS
v_avg_sal number;
BEGIN
SELECT avg(salary) INTO v_avg_sal FROM employees WHERE department_id = p_dept_id;
UPDATE func_usages SET number_of_usage = number_of_usage+1;
RETURN v_avg_sal;
END get_avg_sal;Which of the following code will work fine?
SELECT get_avg_sal(50) FROM dual;SELECT get_avg_sal('50') FROM dual;SELECT get_avg_sal(sysdate-hire_date) FROM employees WHERE employee_id = 100;- None of them will work