Step By Step PL/SQL Tutorial ( Third Step : Two Parameters )

If you want to give two parameters to the function just try this ;

CREATE OR REPLACE FUNCTION lets_try_two_params  ( p_first_num IN NUMBER, p_second_num IN NUMBER)
RETURN varchar2
IS
   employee_name varchar2(500);
BEGIN
   SELECT  EMP_NAME INTO employee_name 
   FROM EMPLOYEE 
   WHERE EMPLOYEE_AGE < p_first_num and EMPLOYEE_AGE > p_second_num ;
RETURN employee_name;
END;
/
Calling the function from SQL is same like others..
  Select lets_try_two_params  ('25','40') from dual;

Comments