nerdexam
Oracle

1Z0-146 · Question #13

Which two statements are true about nested tables and varrays? (Choose two.)

The correct answer is A. Only varrays must have consecutive numbers as subscripts. D. Both nested tables and varrays can be used as column types in database tables. Nested tables might not have consecutive subscripts, while arrays are always dense (have consecutive subscripts). Initially, nested tables are dense, but they can become sparse (have nonconsecutive subscripts). You can delete elements from a nested table using the built-in…

Writing Executable Statements

Question

Which two statements are true about nested tables and varrays? (Choose two.)

Options

  • AOnly varrays must have consecutive numbers as subscripts.
  • BOnly nested tables can be used as column types in database tables.
  • CBoth nested tables and varrays must have consecutive numbers as subscripts.
  • DBoth nested tables and varrays can be used as column types in database tables.

How the community answered

(61 responses)
  • A
    82% (50)
  • B
    11% (7)
  • C
    7% (4)

Explanation

Nested tables might not have consecutive subscripts, while arrays are always dense (have consecutive subscripts). Initially, nested tables are dense, but they can become sparse (have nonconsecutive subscripts). You can delete elements from a nested table using the built-in procedure DELETE. The built-in function NEXT lets you iterate over all the subscripts of a nested table, even if the sequence has gaps. Understanding PL/SQL Collections PL/SQL offers these collection types: Associative arrays, also known as index-by tables, let you look up elements using arbitrary numbers and strings for subscript values. These are similar to hash tables in other programming Nested tables hold an arbitrary number of elements. They use sequential numbers as subscripts. You can define equivalent SQL types, allowing nested tables to be stored in database tables and manipulated through SQL. Varrays (short for variable-size arrays) hold a fixed number of elements (although you can change the number of elements at runtime). They use sequential numbers as subscripts. You can define equivalent SQL types, allowing varrays to be stored in database tables. They can be stored and retrieved through SQL, but with less flexibility than nested tables.

Topics

#nested tables#varrays#collection types#subscripts

Community Discussion

No community discussion yet for this question.

Full 1Z0-146 Practice