SQL no puede usar tipos declarados en el ámbito PL/SQL local. Debe definirlo en SQL (*) :
SQL> create TYPE array_of_numbers IS TABLE OF NUMBER ;
2 /
Type created.
SQL>
Luego use el operador TABLE() para convertir la primera colección en una subconsulta a la que puede hacer referencia con el operador IN:
SQL> set serveroutput on
SQL> declare
2 v_list_parentID array_of_numbers;
3 v_list_pNummer array_of_numbers;
4 begin
5 select dbuid bulk collect into v_list_parentID
6 from v_catalog
7 where parentid = 1;
8 dbms_output.put_line('v_list_parentID count = ' || v_list_parentID.count());
9
10 select primitivumnummer bulk collect into v_list_pNummer
11 from cw_felddaten
12 where katalog in (select * from table( v_list_parentID));
13
14 dbms_output.put_line('v_list_pNummer count = ' || v_list_pNummer.count());
15 end;
16 /
v_list_parentID count = 4
v_list_pNummer count = 24
PL/SQL procedure successfully completed.
SQL>
La sintaxis MEMBER OF también funciona. Escribe menos, pero es posible que no funcione tan bien como el operador TABLE() si CW_FELDDATEN tiene muchas filas.
SQL> declare
2 v_list_parentID array_of_numbers;
3 v_list_pNummer array_of_numbers;
4 begin
5 select dbuid bulk collect into v_list_parentID
6 from v_catalog
7 where parent_id = 1;
8 dbms_output.put_line('v_list_parentID count = ' || v_list_parentID.count());
9
10 select primitivumnummer bulk collect into v_list_pnummer
11 from cw_felddaten
12 where katalog member of v_list_parentID;
13
14 dbms_output.put_line('v_list_pNummer count = ' || v_list_pNummer.count());
15 end;
16 /
v_list_parentID count = 4
v_list_pNummer count = 24
PL/SQL procedure successfully completed.
SQL>