- All Implemented Interfaces:
- HplObject
public class Table
extends Object
implements HplObject
Oracle's PL/SQL Table/associative array.
Tables can be modelled after a corresponding Hive table or they can be created manually.
1. Model the table after the emp Hive table
TYPE t_tab IS TABLE OF emp%ROWTYPE INDEX BY BINARY_INTEGER;
2. Model the table after a column of a Hive table (emp.name). This table will hold a single column only.
TYPE t_tab IS TABLE OF emp.name%TYPE INDEX BY BINARY_INTEGER;
3. Or you can specify the column manually. This table will hold one column only.
TYPE t_tab IS TABLE OF NUMBER INDEX BY BINARY_INTEGER;
In the first case the values will be records where each key in the record matches the columns to the corresponding table.
tab(key).col_name;
In the last two cases the values will represent scalars but they stored in a record with a single key.
tab(key)
Iteration logic uses the first/last next and prior methods.
First/last returns a key, next/prior gives back the next or previous key based on the key passed in.