Oracle Database: Program with PL/SQL — Question 54
Select a valid reason for using VARRAYS.
Answer options
- A. When the amount of data to be held in the collection is widely variable.
- B. As a column in a table when you want to retrieve the collection data for certain rows by ranges of values.
- C. When you want to delete elements from the middle of the collection.
- D. As a column in a table when you want to store no more than 10 elements in each row’s collection.
Correct answer: B
Explanation
Option B is correct because VARRAYS are designed to be retrieved as a whole for specific rows, especially when dealing with ranges of values. Option A is incorrect as VARRAYS are best suited for fixed sizes, C is wrong because VARRAYS do not support easy deletion of elements from the middle, and D is too restrictive as VARRAYS can hold more than 10 elements.