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 butcan use the same
names.
B, E
B,E
B,E
B,E
B,E
E is correct, that is the whole point of overloading procedures
You can overload subprograms if their formal parameters differ only in numeric data type. PL/SQL lets you overload local subprograms, packaged subprograms, and type methods. You can use the same name for several different subprograms as long as their formal parameters differ in number, order, or data type family.
You can place the two initialize procedures in the same block, subprogram, same package.
A, E are the best answers I believe.
procedures can be overload and still not part of a package.
Bellow works for 11g.
create or replace procedure a(a number)
as
begin
null;
end;
/
create or replace procedure a(a varchar2)
as
begin
null;
end;
execute a(1);
execute a(‘1’);
Dear Mike, you are not right.
When you “create or replace” procedure a(a varchar2), procedure a(a number) is replaced.
When you call “execute a(1);”, Oracle does implicit conversion and procedure a(a varchar2) is executed.
Just check the following query after executing the second “create or replace” to get sure:
select count(1) from user_objects
where upper(object_type) = ‘PROCEDURE’ and upper(object_name) = ‘A’;
B,E
it does not need to be Packaged, they can not be stand alone
They can be a local procedure inside another procedure..
Very couple of sites that occur to become detailed beneath, from our point of view are undoubtedly properly worth checking out.
B E