Associative Arrays

1.   An associative array in Oracle is a PL/SQL collection that stores key-value pairs, where the key can be either an integer or a string.

2.   Associative arrays are also known as index-by tables because each element is accessed using a unique index rather than a fixed position.

3.   They are unbounded in size, meaning you do not need to define a maximum number of elements at declaration time.

4.   Associative arrays exist only in memory and cannot be stored directly in database tables or used as table columns.

5.   The indexes in an associative array do not have to be sequential, so the collection can be sparse with gaps between index values.

6.   Associative arrays provide very fast data access because elements are stored in memory and accessed using their index keys.

7.   They are commonly used for temporary data storage, lookups, and caching data within PL/SQL programs.

8.   Associative arrays can be passed as parameters between PL/SQL procedures and functions within the same session.

9.   Unlike nested tables and VARRAYs, associative arrays cannot be directly queried using SQL statements.

10.  Associative arrays automatically grow as elements are added, making them flexible and efficient for dynamic data processing.

No comments:

Post a Comment