Examine this package specification:
CREATE OR REPLACE PACKAGE concat_all
IS
v_string VARCHAR2(100);
PROCEDURE combine (p_num_val NUMBER);
PROCEDURE combine (p_date_val DATE);
PROCEDURE combine (p_char_val VARCHAR2, p_num_val NUMBER);
END concat_all;
/
Which overloaded COMBINE procedure declaration can be added to this package specification?
A.
PROCEDURE combine;
B.
PROCEDURE combine (p_no NUMBER);
C.
PROCEDURE combine (p_val_1 VARCHAR2, p_val_2 NUMBER;
D.
PROCEDURE concat_all
(p_num_val VARCHAR2, p_char_val NUMBER);
Explanation:
You use the package overloading feature when the same operation is performed using arguments
of
different types.
Incorrect Answers:
B: This procedure conflicts with the first procedure declaration in that its parameters differs only by
name but have the same data type. You cannot use two procedures with the same name if their
parameters differ only in name or mode.
C: This procedure conflicts with the third procedure declaration in that its parameters differs only
by name but have the same data type.
D: This procdure can’t be overloaded because it does not use the same name. Package
overloading allows more than one procedure or function inside the package to use the same
name.