Which two rules should you apply to ensure that the overloading feature is used successfully?

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.)

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.



Leave a Reply 13

Your email address will not be published. Required fields are marked *


User

User

E is correct, that is the whole point of overloading procedures

Jen

Jen

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.

Mike

Mike

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’);

Mikhail

Mikhail

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’;

SK

SK

it does not need to be Packaged, they can not be stand alone
They can be a local procedure inside another procedure..

Google

Google

Very couple of sites that occur to become detailed beneath, from our point of view are undoubtedly properly worth checking out.