Passing Default Values:
As the given example display, you can initialize IN parameters to default values. On That way, various numbers of actual parameters can be passed to a subprogram, overriding or accepting the default values.
PROCEDURE create_dept (
new_dname CHAR DEFAULT 'TEMP',
new_loc CHAR DEFAULT 'TEMP') IS
BEGIN
INSERT INTO dept
VALUES (deptno_seq.NEXTVAL, new_dname, new_loc); # declaring values#
The default value of its corresponding formal parameter is used if an actual parameter is not passed. Let consider the following calls to create_dept:
Exec create_dept;
Exec create_dept('MARKETING');
Exec create_dept('MARKETING', 'NEW YORK');
First call passes no actual parameters and then both default values are used. Second call passes one actual parameter and then the default value for new_loc is used. Third call passes two actual parameters then neither default value is used.