Friday, November 6, 2009

Chapter 18 Collections

Team-Fly
 

 

Oracle® PL/SQL® Interactive Workbook, Second Edition
By
Benjamin Rosenzweig, Elena Silvestrova
Table of Contents

Appendix A. 
Answers to Self-Review Questions



Chapter 18 Collections



Lab 18.1 Self-Review Answers

A1:


Questions


Answers


Comments


1)


A

 

A2:


Questions


Answers


Comments


2)


C


You will recall that a following is always used in an index-by table declaration




INDEX BY BINARY_INTEGER;

A3:


Questions


Answers


Comments


3)


A


A nested table is automatically NULL when it is declared. As a result, it must be initialized prior to its use.

A4:


Questions


Answers


Comments


4)


C


If a PL/SQL table contains only one element, it is its first and last element. As a result, the FIRST method returns the subscript of the first element, 1, and the LAST method returns the subscript of the last element, 1.

A5:


Questions


Answers


Comments


5)


C


It is important to remember that a PL/SQL table in this case is a nested table. You will recall that the DELETE method cannot be used with a nested table.





Lab 18.2 Self-Review Answers

A1:


Questions


Answers


Comments


1)


A


You will recall that using a DELETE method on varrays causes a syntax error because varrays are dense.

A2:


Questions


Answers


Comments


2)


B


A varray can contain a number of elements, varying from zero (empty array) to its maximum size. In other words, an upper bond of the array can be extended to its maximum size.

A3:


Questions


Answers


Comments


3)


A

 

A4:


Questions


Answers


Comments


4)


C


The COUNT method returns the current number of varray elements, and the LIMIT method returns the maximum number of elements that a varray can contain.

A5:


Questions


Answers


Comments


5)


D


Because varrays cannot be sparse, a DELETE method causes a syntax error when it is issued against a varray.





Lab 18.3 Self-Review Answers

A1:


Questions


Answers


Comments


1)


A

 

A2:


Questions


Answers


Comments


2)


B


Regardless of its element type, an upper bound of a varray can be extended to its maximum size.

A3:


Questions


Answers


Comments


3)


B


A nested table must be initialized prior to its use regardless its element data type.





    Team-Fly
     

     
    Top
     

    No comments: