Functions for error trapping are contained in which section of a PL/SQL block?
-
Header
-
Declarative
-
Executable
-
Exception
PL/SQL blocks have four sections: Header (optional, for named blocks), Declarative (DECLARE section for variables, types, cursors), Executable (BEGIN...END for main logic), and Exception (EXCEPTION section for error trapping and handling). The Exception section specifically contains functions and handlers for errors.
To answer this question, you need to understand the structure of a PL/SQL block. A PL/SQL block consists of three sections: the header, the declarative section, and the executable section. The header section contains the declaration of the PL/SQL block, including its name, parameters, and return type. The declarative section contains variable declarations, cursor declarations, and other items that are used within the block. The executable section contains the actual code that is executed when the block is invoked.
The correct answer is:
D. Exception - Functions for error trapping are contained in the exception section of a PL/SQL block. The exception section is used to catch and handle any errors that occur during the execution of the block. It contains exception handlers, which specify how to handle specific types of errors.