Functions for error trapping are contained in which section of a PL/SQL block?

  1. Header

  2. Declarative

  3. Executable

  4. Exception


Correct Option: C,D

AI Explanation

To answer this question, we need to understand the structure of a PL/SQL block.

A PL/SQL block is divided into three sections:

  1. Header: This section is optional and is used to declare the name and parameters of the PL/SQL block.

  2. Declarative: This section is also optional and is used to declare variables, cursors, types, and other program objects that are used within the block.

  3. Executable: This section contains the actual executable code of the PL/SQL block.

The correct answer is:

C. Executable: The executable section is where the main code logic of the PL/SQL block is written. It contains statements and control structures that are executed sequentially.

D. Exception: The exception section is used to handle and trap errors that may occur during the execution of the PL/SQL block. It contains error-handling code that is executed when an exception is raised.

Therefore, the functions for error trapping are contained in the executable and exception sections of a PL/SQL block.

Find more quizzes: