I have something like this, but got an error says ORA-06533: Subscript beyond count. I want to see all the values from the "select distinct" statement in the output tab. Anyone can help? thanks!
DECLARE
TYPE v_chks_array IS VARRAY (10) OF VARCHAR2 (50);
arrSRCs v_chks_array;
BEGIN
arrSRCs := v_chks_array ();
arrSRCs.EXTEND (10);
SELECT /*+parallel (a,4)*/
DISTINCT a.src_table
BULK COLLECT INTO arrSRCs
FROM hcr_dm.hcr_dm_fact a;
DBMS_OUTPUT.put_line (arrSRCs (10));
END;
Collections are not needed here:
begin
for results in
(
select /*+ parallel (a,4) */ distinct a.src_table
from hcr_dm.hcr_dm_fact a;
) loop
dbms_output.put_line(results.src_table);
end loop;
end;
/