Passing Default Values Assignment Help

Assignment Help: >> Parameters - Passing Default Values

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.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd