Map data structure in pl / sql to store a pair of key values?

In any case, to create a map data structure in pl / sql.

+7
plsql data-structures map
source share
1 answer

There is an associative PL / SQL 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 scroll through the elements as follows:

  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; 
+23
source share

All Articles