Oracle Database 11g: Program with PL/SQL — Question 68
In which of the following scenarios would you recommend using PL/SQL records?
Answer options
- A. when you want to retrieve an entire row from a table and perform calculations
- B. when you know the number of elements in advance and the elements are usually accessed sequentially
- C. when you want to create a separate lookup table with multiple entries for each row of the main table, and access it through join queries
- D. when you want to create a relatively small lookup table, where the collection can be constructed in memory each time a subprogram is invoked
Correct answer: A
Explanation
The correct answer is A because PL/SQL records are ideal for retrieving an entire row from a table, allowing for easy manipulation of the data. Options B, C, and D describe scenarios that are better suited for collections or other data structures, which do not take full advantage of the record's capability to handle row-level data efficiently.