Is there anyway to create a map data structure in pl/sql.
There is the PL/SQL associative array
DECLARE
TYPE salary_tab_t IS TABLE OF NUMBER INDEX BY VARCHAR2(30);
salary_tab salary_tab_t;
BEGIN
salary_tab('JONES') := 10000;
salary_tab('SMITH') := 12000;
salary_tab('BROWN') := 11000;
END;
You can loop through the elements like this:
l_idx := salary_tab.FIRST;
LOOP
EXIT WHEN l_idx IS NULL;
dbms_output.put_line (salary_tab(l_idx));
l_idx := salary_tab.NEXT(l_idx);
END LOOP;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With