Explain the significance of Return clause in stored procedure.
Return clause in a stored procedure returns the value to the calling programs subroutine.
Return statement in a stored procedure is not to return values. It simply returns control to the caller before the end of the procedure.
Example:The procedure below returns the salary for the employee id passed.
CREATE OR REPLACE FUNCTION GET_EMPLOYEE_SALARY
(
p_employee_id NUMBER
)
RETURN FLOAT
IS p_salary FLOAT(25);
BEGIN
SELECT salary INTO p_salary FROM EMPLOYEES
WHERE EMPLOYEE_ID = p_employee_id;
RETURN p_salary;
END GET_EMPLOYEE_SALARY;