I am looking for a direct way to assign a number nested table to a varchar2 nested table. I know of two ways. Method 3 raises an ORA-06550. What other efficient ways are available? My database version is 10.2.0.4
create or replace type num_ntt is table of number;
/
create or replace type vc2_ntt is table of varchar2(4000);
/
declare
num num_ntt := num_ntt();
vc2 vc2_ntt := vc2_ntt();
begin
for i in 1..10 loop
num.extend;
num(i) := i;
end loop;
--Method 1
for i in 1..num.count loop
vc2.extend;
vc2(i) := num(i);
end loop;
--Method 2
select * bulk collect into vc2 from table( num );
--Method 3
vc2 := num;
end;
/