Monday, December 31, 2012

Oracle PL/SQL Collection

Nested tables can be stored in a database column, but associative arrays cannot.
Nested tables are appropriate for important data relationships that must be stored persistently.

Varrays are a good choice when the number of elements is known in advance, and when the elements are usually all accessed in sequence. When stored in the database, varrays retain their ordering and subscripts.
Each varray is stored as a single object, either inside the table of which it is a column (if the varray is less than 4KB) or outside the table but still in the same tablespace (if the varray is greater than 4KB). You must update or retrieve all elements of the varray at the same time, which is most appropriate when performing some operation on all the elements at once. But you might find it impractical to store and retrieve large numbers of elements this way.

No comments:

Post a Comment