Function and Procedure Architecture
Review Section
This section has described the following points about the architecture of functions and procedures:
1. Pass-by-value functions are black boxes that perform tasks by consuming inputs and returning a completely new result.
2. Pass-by-value procedures are black boxes that perform tasks by consuming inputs without returning a result.
3. Pass-by-reference functions are black boxes that perform tasks by consuming some inputs and returning other inputs as altered values to the calling variables, and returning a completely new result.
4. Pass-by-reference procedures are black boxes that perform tasks by consuming some inputs and returning other inputs as altered values to the calling variables.
5. Inline functions and procedures run in the same transaction scope as the calling program unit.
6. Autonomous functions and procedures run in a different transaction scope from the calling program unit.
7. The IN mode is the default mode and is a pass-by-value parameter, and the IN OUT and OUT modes are pass-by-reference parameters.
8. The ACCESSIBLE BY clause lets you white list functions and procedures.
9. Final control of whether the NOCOPY hint passes a copy or a reference to the parameter rests with Oracle’s PL/SQL engine.