What are formal and actual parameters?
What are formal and actual parameters?
Rating:
Formal parameters are variables declared in the parameter list of a subprogram (such as a procedure or a function) specification. However, actual parameters are variables or expressions referenced in the parameter list of a subprogram call.
During a subprogram call, actual parameters are evaluated and their values are assigned to formal parameters. An actual parameter can also be in the form of an expression. On the other hand, a formal parameter is always a variable. It is a good practice to use different names for formal and actual parameters. It is Oracle's general convention to prefix the names of formal parameters with p_.
The formal and actual parameters should be of compatible datatypes. If necessary, before assigning the value, PL/SQL converts the datatype of the actual parameter value to that of the formal parameter.
Rating:
Other articles
- What is the difference between a procedure and function?
- How is a SQL statement executed?
- When is the recompilation of a dependent procedure or function unsuccessful?
- What is an AFTER trigger?
- What are the benefits of subprograms?
