You are developing a PL/SQL block designed for bulk data operations. When attemping to store table data for multiple rows in a PL/SQL variable, which one of the following choices identifies the mechanism best suited for this task (choose one)?

  1. Cursor

  2. Varchar2

  3. PL/SQL table

  4. Table of records

  5. Record


Correct Option: D

AI Explanation

To answer this question, you need to understand the different mechanisms available in PL/SQL for storing table data for multiple rows.

Option A) Cursor - A cursor is used to process individual rows returned by a SQL query. It is not the best choice for storing table data for multiple rows in a PL/SQL variable.

Option B) Varchar2 - Varchar2 is a data type used to store character strings. It is not suitable for storing table data for multiple rows.

Option C) PL/SQL table - A PL/SQL table is a collection type that can hold data of the same type. It can be used to store table data for multiple rows. However, it is not the best choice for this task.

Option D) Table of records - This is the correct answer. A table of records is a collection type that can hold multiple rows of data, with each row being a record type. It is specifically designed for bulk data operations and is the best mechanism for storing table data for multiple rows in a PL/SQL variable.

Option E) Record - A record is a composite data type that can hold multiple fields, but it is not designed for storing table data for multiple rows.

The correct answer is D) Table of records. This option is correct because it identifies the mechanism best suited for storing table data for multiple rows in a PL/SQL variable.

Find more quizzes: