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 but can use the same names.



Leave a Reply 10

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


sp

sp

Correct answers: B E

Kuki

Kuki

must be a,e, test it:

CREATE OR REPLACE PROCEDURE GET_CHAR (V_TEXT IN VARCHAR2)
as
BEGIN
NULL;
END;
/
CREATE OR REPLACE PROCEDURE GET_CHAR (V_TEXT IN number)
as
BEGIN
NULL;
END;
/

But again, the question is bad. If my knowledge of english is correct the first answer means: you can use both of them, but you dont have to.
answer b, c: “the procedures should..” means, it can be in packaged subprograms, but it does not have to. Its more like an advice.

snog

snog

B and E is correct
“….that the overloading feature is used successfully?”

You cannot overload procedure in schema scope, therefore A is not correct.

Rohan

Rohan

Kuki – the second procedure replaces the first in your example. Hence I am sure that B and E are correct

Michael

Michael

you used “create OR REPLACE”
so the second definition of get_char drops the first.
try

drop PROCEDURE GET_CHAR;
— how could the drop above statement know which one, if there could be more than one

procedure with the same name in the schema ?
CREATE PROCEDURE GET_CHAR (V_TEXT IN VARCHAR2)
as
BEGIN
NULL;
END;
/
CREATE PROCEDURE GET_CHAR (V_TEXT IN number)
as
BEGIN
NULL;
END;
/

Luz REBOLLO

Luz REBOLLO

ooooo :O

Luz REBOLLO

Luz REBOLLO

B y E