Is there a way in Oracle pl/sql that I can create a datastructure like java Hashmap which can have a record type as value and String as index.
For example;
type emp_rec_type is record (emp_id number,emp_salary number);
emp_rec emp_rec_type;
type emp_assoc_array is table of emp_rec_type indexed by varchar2(30);
emp_map emp_assoc_array;
I would like to be able to do the below
emp_rec.emp_id := 1;
emp_rec.salary := 1000;
emp_map('Rohan') := emp_rec;
Can this be achieved? I cannot use nested tables since I can only index it by integer. With associative arrays, I cannot use object type as attributes.
Also would like to do this without having to create an object or schema datatype. Can you please suggest something?