Beruflich Dokumente
Kultur Dokumente
Review your answers, feedback, and question scores below. An asterisk (*) indicates
a correct answer.
Section 7 Quiz
(Answer all questions in this section)
The block will fail because you cannot explicitly RAISE a predefined Oracle
Server error such as NO_DATA_FOUND
No employees found
Correct Correct
2. You want to display your own error message to the user. What is
the correct syntax to do this? Mark for Review
(1) Points
RAISE application_error;
None of these.
Correct Correct
Correct Correct
5. The following code does not violate any constraints and will not
raise an ORA-02292 error. What will happen when the code is executed?
BEGIN
DECLARE
e_constraint_violation EXCEPTION;
PRAGMA EXCEPTION_INIT(e_constraint_violation, -2292);
BEGIN
DBMS_OUTPUT.PUT_LINE('Inner block message');
END;
EXCEPTION
WHEN e_constraint_violation THEN
DBMS_OUTPUT.PUT_LINE('Outer block message');
END;
Mark for Review
(1) Points
The code will fail because the exception is declared in the inner block but
is referenced in the outer block. (*)
The code will fail because line 4 should read: PRAGMA EXCEPTION_INIT(-2292,
e_constraint_violation);
Correct Correct
Section 7 Quiz
(Answer all questions in this section)
None of these.
Message 1
Message 4
(*)
Message 1
Message 1
Message 3
Message 4
Correct Correct
7. How can you retrieve the error code and error message of any
Oracle Server exception? Mark for Review
(1) Points
By using RAISE_APPLICATION_ERROR
TOO_MANY_ROWS (*)
NO_DATA_FOUND (*)
ZERO_DIVIDE (*)
E_INSERT_EXCEP
Correct Correct
TOO_MANY_ROWS
NO_DATA_FOUND
DUP_VAL_ON_INDEX
ZERO_DIVIDE
Correct Correct
10. Which kind of error can NOT be handled by PL/SQL? Mark for
Review
(1) Points
User-defined errors
Correct Correct
Section 7 Quiz
(Answer all questions in this section)
An error occurred
Correct Correct
None of these.
Any other kind of exception that can occur within the block
Correct Correct
An error occurs during execution which disrupts the normal operation of the
program. (*)
The programmer makes a spelling mistake while writiing the PL/SQL code.
Correct Correct
EXCEPTION
WHEN OTHERS THEN statement_1;
WHEN NO_DATA_FOUND THEN statement_2;
END;
EXCEPTION
WHEN NO_DATA_FOUND THEN statement_1;
WHEN OTHERS THEN statement_2;
END;
(*)
EXCEPTION
WHEN TOO_MANY_ROWS THEN statement_1;
END;
(*)
EXCEPTION
WHEN NO_DATA_FOUND THEN statement_1;
WHEN NO_DATA_FOUND THEN statement_2;
WHEN OTHERS THEN statement_3;
END;
EXCEPTION
WHEN OTHERS THEN statement_1;
END;
(*)
Correct Correct
The programmer forgets to declare a cursor while writing the PL/SQL code.
An error occurs during the execution of the block, which disrupts the normal
operation of the program. (*)
Correct Correct