oracle initialization varchar collection
DECLARE
TYPE by_string_t IS TABLE OF INTEGER
INDEX BY VARCHAR2(100);
l_stuff by_string_t := by_string_t ('Steven' => 55, 'Loey' => 555, 'Juna' => 5555);
l_index varchar2(100) := l_stuff.first;
BEGIN
DBMS_OUTPUT.put_line (l_stuff.count);
WHILE l_index IS NOT NULL
LOOP
DBMS_OUTPUT.put_line (l_index || ' => ' || l_stuff (l_index));
l_index := l_stuff.NEXT (l_index);
END LOOP;
END;
/
3
Juna => 5555
Loey => 555
Steven => 55