Skip to Content

Oracle 1z0-149: Exception Handling in PL/SQL

Learn about exception handling in Oracle PL/SQL for the 1z0-149 certification exam. Understand predefined exceptions, user-defined exceptions, and their declaration and handling.

Table of Contents

Question

Which two are true about exception handling? (Choose two.)

A. Internally defined exceptions can be handled only by the OTHERS exception handler.
B. All declared exceptions are raised implicitly by the runtime system.
C. User-defined exceptions can be defined in the declarative part of any PL/SQL anonymous block, subprogram, or package.
D. Only predefined exceptions and user-defined exceptions can have a user-declared name associated with them.
E. Predefined exceptions are globally declared in the standard package.

Answer

C. User-defined exceptions can be defined in the declarative part of any PL/SQL anonymous block, subprogram, or package.
E. Predefined exceptions are globally declared in the standard package.

Explanation

C. User-defined exceptions can be declared in the declarative part of any PL/SQL anonymous block, subprogram, or package. This allows developers to define and handle custom exceptions specific to their application’s needs.

E. Predefined exceptions are globally declared in the STANDARD package, which is automatically available to all PL/SQL programs. These exceptions cover common error conditions such as NO_DATA_FOUND, TOO_MANY_ROWS, and INVALID_NUMBER.

A is incorrect because internally defined exceptions can be handled by specific exception handlers, not just the OTHERS handler.

B is incorrect because not all declared exceptions are raised implicitly. User-defined exceptions must be explicitly raised using the RAISE statement.

D is incorrect because internally defined exceptions, like NO_DATA_FOUND and TOO_MANY_ROWS, do not have user-declared names associated with them.

Oracle Database Program with PL/SQL 1z0-149 certification exam practice question and answer (Q&A) dump with detail explanation and reference available free, helpful to pass the Oracle Database Program with PL/SQL 1z0-149 exam and earn Oracle Database Program with PL/SQL 1z0-149 certification.