|Oracle® Database PL/SQL Language Reference
11g Release 1 (11.1)
|PDF · Mobi · ePub|
A parameter declaration can appear in in following:
The data type of the parameter that you are declaring. You cannot constrain this data type (with
NULL, for example).
Parameter modes that define the action of formal parameters. For summary information about parameter modes, see Table 8-1.
OUTwith functions. The purpose of a function is to take zero or more parameters and return a single value. Functions must be free from side effects, which change the values of variables not local to the subprogram.
NOCOPY to instruct the database to pass this argument as fast as possible. This clause can significantly enhance performance when passing a large value like a record, an index-by table, or a varray to an
IN parameter values are always passed
When you specify
NOCOPY, assignments made to a package variable may show immediately in this parameter, or assignments made to this parameter may show immediately in a package variable, if the package variable is passed as the actual assignment corresponding to this parameter.
Similarly, changes made either to this parameter or to another parameter may be visible immediately through both names if the same variable is passed to both.
If the subprogram is exited with an unhandled exception, then any assignment made to this parameter may be visible in the caller's variable.
These effects might or might not occur on any particular call. Use
NOCOPY only when these effects would not matter.
The name of the formal parameter that you are declaring, which you can reference in the body of the subprogram.
Specifies a default value for an
IN parameter. If the invoker of the subprogram specifies a value for the parameter, then
expression is not evaluated for that invocation (see Example 8-7). Otherwise, the parameter is initialized to the value of
expression. The value and the parameter must have compatible data types.