What prevents this procedure from being created successfully?

Examine this procedure:
CREATE OR REPLACE PROCEDURE DELETE_PLAYER
(V_ID IN NUMBER)
IS
BEGIN

DELETE FROM PLAYER
WHERE ID = V_ID;
EXCEPTION
WHEN STATS_EXITS_EXCEPTION
THEN DBMS_OUTPUT.PUT_LINE
(‘Cannot delete this player, child records exist in PLAYER_BAT_STAT table’);
END;
What prevents this procedure from being created successfully?

Examine this procedure:
CREATE OR REPLACE PROCEDURE DELETE_PLAYER
(V_ID IN NUMBER)
IS
BEGIN

DELETE FROM PLAYER
WHERE ID = V_ID;
EXCEPTION
WHEN STATS_EXITS_EXCEPTION
THEN DBMS_OUTPUT.PUT_LINE
(‘Cannot delete this player, child records exist in PLAYER_BAT_STAT table’);
END;
What prevents this procedure from being created successfully?

A.
A comma has been left after the STATS_EXIST_EXCEPTION exception.

B.
The STATS_EXIST_EXCEPTION has not been declared as a number.

C.
The STATS_EXIST_EXCEPTION has not been declared as an exception.

D.
Only predefined exceptions are allowed in the EXCEPTION section.

Explanation:
You can’t raise an exception that has not been declared.
Incorrect Answers:
A: This is the correct syntax for raising an exception.
B: The STATS_EXIST_EXCEPTION needs to be declared as an exception not as a number.



Leave a Reply 0

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