View the Exhibit and examine the structure of the EMP table.
You want to create two procedures using the overloading feature to search for employee details
based on either the employee name or employee number. Which two rules should you apply to
ensure that the overloading feature is used successfully? (Choose two.)
A.
The procedures can be either stand-alone or packaged.
B.
The procedures should be created only as packaged subprograms
C.
The procedures should be created only as stand-alone subprograms
D.
Each subprogram’s formal parameters should differ in both name and data type.
E.
The formal parameters of each subprogram should differ in data type but can use the same
names.
Explanation:
b,e
http://docs.oracle.com/cd/E11882_01/appdev.112/e25519/subprograms.htm#LNPLS673
B,D
B,E
Subprograms that You Cannot Overload
——————————————–
•Standalone subprograms
•Subprograms whose formal parameters differ only in mode; for example:
PROCEDURE s (p IN VARCHAR2) IS …
PROCEDURE s (p OUT VARCHAR2) IS …
•Subprograms whose formal parameters differ only in subtype; for example:
PROCEDURE s (p INTEGER) IS …
PROCEDURE s (p REAL) IS …
INTEGER and REAL are subtypes of NUMBER, so they belong to the same data type family.
•Functions that differ only in return value data type, even if the data types are in different families; for example:
FUNCTION f (p INTEGER) RETURN BOOLEAN IS …
FUNCTION f (p INTEGER) RETURN INTEGER IS …
PL/SQL lets you overload subprogram names and type methods. You can use the same name for several different subprograms as long as their formal parameters differ in number, order, or datatype family.
B,E
B E
B,E
B,E