Hello,
I have an associative array where I can store index-value pairs, something like
TYPE t_tab_emp IS TABLE OF emp%ROWTYPE
INDEX BY PLS_INTEGER;
tab_emp t_tab_emp;
Until now this was a good solution because the index is sparse with a wide range of values, e.g. like empno, and I could simply check whether an element exists or add an element by
IF tab_emp.EXISTS(3456) THEN
...
tab_emp(3498) := ...
The new requirement is to use a SQL-type because it is needed outside PL/SQL.
When I just say
TYPE t_nt_emp IS TABLE OF emp%ROWTYPE;
nt_emp t_nt_emp := t_nt_emp();
I cannot simply use the subscript since it is initially dense and I would have to create (empty) elements until I reach my empno.
Is there a simple way to see in my example whether an element 3456 exists if this number is not the subscript but an element of emp%ROWTYPE?
The elements are filled randomly, have to be updated and finally processed ordered by empno.
Regards
Marcus