Which two statements will successfully invoke this procedure in SQL *Plus? (Choose two)

Examine this procedure:
CREATE OR REPLACE PROCEDURE UPD_BAT_STAT
(V_ID IN NUMBER DEFAULT 10, V_AB IN NUMBER DEFAULT 4) IS
BEGIN
UPDATE PLAYER_BAT_STAT
SET AT_BATS = AT_BATS + V_AB
WHERE PLAYER_ID = V_ID;
COMMIT;
END;
Which two statements will successfully invoke this procedure in SQL *Plus? (Choose two)

Examine this procedure:
CREATE OR REPLACE PROCEDURE UPD_BAT_STAT
(V_ID IN NUMBER DEFAULT 10, V_AB IN NUMBER DEFAULT 4) IS
BEGIN
UPDATE PLAYER_BAT_STAT
SET AT_BATS = AT_BATS + V_AB
WHERE PLAYER_ID = V_ID;
COMMIT;
END;
Which two statements will successfully invoke this procedure in SQL *Plus? (Choose two)

A.
EXECUTE UPD_BAT_STAT;

B.
EXECUTE UPD_BAT_STAT(V_AB=>10, V_ID=>31);

C.
EXECUTE UPD_BAT_STAT(31, ‘FOUR’,’TWO’);

D.
UPD_BAT_STAT(V_AB=>10, V_ID=>31);

E.
RUN UPD_BAT_STAT;

Explanation:
A: This is the correct syntax for invoking a function from SQL *Plus. Actual parameters are not needed since the procedure has default values defined for each formal parameter. The EXECUTE or EXEC statement is used to invoke an independent procedure from SQL*Plus. The EXECUTE or EXEC keyword is followed by the name of the procedure and arguments.
B: This is the correct syntax for invoking this function using positional notation.
Incorrect Answers
C: This would fail, too many parameters are passed. The procedure being called only has two parameters.
D: If this statement was invoked from inside an anonymous PL/SQL Block or from another procedure you would omit the EXECUTE.
E: Run is not a valid command for invoking a procedure.



Leave a Reply 1

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


more information

more information

Thanks for every other fantastic article. The place else could anyone get that type of info in such a perfect manner of writing? I’ve a presentation next week, and I’m at the search for such information.|