In the previous modules, you learned to create three different types of PL/SQL stored objects: functions, procedures, and triggers.
A later lesson covers a fourth type of stored object: the PL/SQL package. This lesson covers how to use a parameter in a procedure.
There are three modes of parameters:
- IN: A parameter that comes into a PL/SQL stored object. It cannot be modified within the object.
- OUT: A parameter that is sent from the PL/SQL stored object to the executing environment. It can be modified within the object.
- IN OUT: A parameter that is brought into the PL/SQL stored object and also sent out. It can be modified within the object.
The following Slideshow shows you the syntax for using parameters with a procedure, a sample of a procedure that specifies parameters, and then shows you the three methods that can be used to specify parameters when calling the procedure.
1) This shows the syntax of placing parameters into a procedure.
2) Here is a partial example of a procedure containing parameters.
3) Here is a partial example of a PL/SQL block that calls the DO_ADDRESS procedure.
4) There are actually three ways to specify the parameters when calling a procedure.
5) An advantage to this method is that the actual names of the parameters in the called procedure are not used,
6) An advantage to this method is that the actual names of the parameters in the called procedure are not used,
7) The third method of specifying parameters is by using a mixture of position and assignment methods.
Parameter Syntax Procedure Examples
As described in the Slideshow above, you can call a procedure and list the parameters needed by using any of three methods. The most common method is first, where you list each parameter value in the same order as it is defined in the procedure.
The next lesson explores use of parameters and the RETURN command in a function.