Page 246
Listing 9.16. Use of different argument typesIN, OUT, and IN OUT.
SQL> declare 2 2 This_Arg1 number; 3 This_Arg2 number; 4 This_Arg3 number; 5 5 procedure Different_Arguments 6 (arg1 IN number, 7 arg2 OUT number, 8 arg3 IN OUT number) is 9 9 begin 10 10 arg2 := arg1; 11 arg3 := arg3 + 1; 12 12 end; 13 13 -- Beginning of executable section of anonymous block. 14 14 begin 15 15 This_Arg1 := 3.14159; 16 16 Different_Arguments (This_Arg1, This_Arg2, This_Arg3); 17 17 end; 18 / PL/SQL procedure successfully completed.
This lesson discussed these basic features of PL/SQL:
Page 247
DO DON'T |
DO use PL/SQL for enforcing business rules in the Oracle database. |
On Day 10, you learn much more about the declaration and use of procedures, functions, and packages.
Q Can a function call other procedures and functions and can a procedure call other procedures and functions?
A Yes, this is supported by PL/SQL. In fact, PL/SQL also supports recursion.
The purpose of the Workshop is to allow you to test your knowledge of the material discussed in the lesson. See if you can correctly answer the questions in the quiz and complete the exercise before you continue with tomorrow's lesson.
Construct an anonymous block that declares a procedure that will set the additional fees for a course to $50 if there are no current additional fees. The procedure should have only one argumentDepartment_IDand should perform this action only for the value of Department_ID supplied to the procedure.
Page 248