Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 3. Laying the Groundwork: PL/SQL... > Parameters of subprograms

Parameters of subprograms

In previous examples, we show you how data can be passed to subprograms by using parameters. But there are really two kinds of parameters:

  • Formal parameters are variables that you define in the declaration part of the subprogram (for example, variables i_rad1_nr and i_rad2_nr are formal parameters of the function F_GetDiff_NR from Listing A Function Example ). These are the only elements of the subprogram visible to the outside world.

  • Actual parameters are what you pass from the main program into the subprogram. (In Listing Stopping Procedure Execution , you passed literals 3, 4, 5, and 6 to the function F_GetDiff_NR, so these were actual parameters of that function.) Depending upon the type of formal parameter, actual parameters could be literals, variables, expressions, and so on. If you have more than one layer of subprogram, the formal parameter on a higher level could be an actual parameter of the lower one (for example, variable i_rad1_nr is an actual parameter of function f_getArea_Nr and a formal parameter of function f_getDiff_Nr).

If possible, Oracle dynamically converts datatypes of actual parameters to match formal parameters.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint