Multiple choice technology databases

Which of the following is not a valid Oracle PL/SQL exception.

  1. NO_DATA_FOUND ORA-01403

  2. DUP_VAL_ON_INDEX ORA-00001

  3. TWO_MANY_ROWS ORA-01422

  4. OTHERS

  5. None of the above. These are all valid.

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

To solve this question, the user needs to have knowledge of Oracle PL/SQL exceptions and their syntax.

The correct answer is option C. TWO_MANY_ROWS ORA-01422 is not a valid Oracle PL/SQL exception.

Explanation for each option:

A. NO_DATA_FOUND ORA-01403: This is a valid exception in Oracle PL/SQL. It is raised when a SELECT INTO statement returns no rows.

B. DUP_VAL_ON_INDEX ORA-00001: This is a valid exception in Oracle PL/SQL. It is raised when a unique index constraint is violated.

C. TWO_MANY_ROWS ORA-01422: This is not a valid exception in Oracle PL/SQL. It is an invalid exception.

D. OTHERS: This is a valid exception in Oracle PL/SQL. It is used to catch any exception that is not explicitly handled.

E. None of the above. These are all valid: This option is incorrect as option C is not a valid exception.

Therefore, the answer is: C.

AI explanation

Oracle PL/SQL has these predefined exceptions: NO_DATA_FOUND (ORA-01403), DUP_VAL_ON_INDEX (ORA-00001), TOO_MANY_ROWS (ORA-01422), and the catch-all OTHERS handler — all genuinely valid. The option marked correct is spelled "TWO_MANY_ROWS", which is not the actual exception name (the real one is TOO_MANY_ROWS, raised when a SELECT INTO returns more than one row). So as literally written, that option is the invalid one — likely a deliberate misspelling trap rather than the exception being conceptually wrong. The other three listed are all legitimate PL/SQL constructs, so "None of the above" is wrong.