Friday, 25 May 2012

What is the difference between formal and actual parameters in a subprogram specification? | PL SQL

 Formal parameters are variables declared as the parameter list in the subprogram specification.
Actual parameters are the values that are passed to the subprogram from the calling environment. The actual parameter values are evaluated and resultant values are assigned to the formal parameters when the program is executed.
Both formal and actual parameters should be of compatible data types.
Following code shows the formal parameters of the function:
CREATE OR REPLACE procedure proc_disp_percentage(p_student_id Number, p_percentage Number)
..........
END proc_disp_percentage

 In the preceding function, p_student_id and p_percentage are the formal parameters.
In the following function code, v_student_id and v_percentage are the actual parameters:
proc_disp_percentage  (v_student_id,  v_percentage);