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 a system event trigger?
- What are the advantages of using user-defined functions in SQL expressions?
- What is an INSTEAD OF trigger?
- What are the locations within a SQL statement from where user-defined functions can be called?
- What is a procedure?
