Significance of Return clause in stored procedure

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;
What are actual and formal parameters in oracle?
Information in subprograms is passed through parameters. If the parameter declared in a subprogram is referenced in the subprogram body, it is called as a formal parameter..
What are sequences? Explain with syntax
A field in oracle can be kept as auto incremented by using sequence. it can be used to create a number sequence......
Advantages of sequences
Sequence ensures that no other session or other call to nextval within the same session gets the same number from the sequence....
Post your comment