* For nested tables, 1 .. 2147483647 (the upper limit of PLS_INTEGER).
* For varrays, 1 .. size_limit, where you specify the limit in the declaration (not to exceed 2147483647).
* For associative arrays with a numeric key, -2147483648 to 2147483647.
* For associative arrays with a string key, the length of the key and number of possible values depends on the VARCHAR2 length limit in the type declaration, and the database character set.
Characteristic
|
Associative Array
|
Nested Table
|
Varray
|
---|---|---|---|
Dimensionality
| Single
| Single
| Single
|
Usable in SQL?
| No
| Yes
| Yes
|
Usable as column datatype in a table?
| No
| Yes; data stored "out of line" (in separate table)
| Yes; data stored "in line" (in same table , if < 4,000 bytes)
|
Uninitialized state
| Empty (cannot be null); elements undefined
| Atomically null; illegal to reference elements
| Atomically null; illegal to reference elements
|
Initialization
| Automatic, when declared
| Via constructor, fetch, assignment
| Via constructor, fetch, assignment
|
Subscript Limit
| BINARY_INTEGER (-2,147,483,647 .. 2,147,483,647)
VARCHAR2 - the length of the key and number of possible values depends on the VARCGAR2 length limit in the type declaration and db characterset. | Positive integer between 1 and 2,147,483,647
| Positive integer between 1 and 2,147,483,647
|
Sparse?
| Yes
| Initially, no; after deletions, yes
| No
|
Bounded?
| No
| Can be extended
| Yes
|
Means of extending
| Assign value to element with a new subscript
| Use built-in EXTEND procedure (or TRIM to condense), with no predefined
|
|
Can be compared for equality?
| No
| Yes, from Oracle Database 10g
| No
|
Can be manipulated with set operators
| No
| Yes, from Oracle Database 10g
| No
|
Retains ordering and subscripts when stored in and retrieved from database?
| N/A
| No
| Yes |
The different ways of querying from a collection is detailed out in one of the article published in OTN. Click Here to access the article.