Creating Collection Dynamically
Hi Guys,
Is there any way to create the PL SQL table dynamically?
For Example:
create procedure p_load_data(i_table_name varchar2,i_ret_string out varchar2)
is
type my_type is table of i_table_name%rowtype index by pls integer;
mt my_type;
begin
Select * bulk collect into mt limit 20000;
forall i in 1..mt.count
insert into fact values (i);
commit;
-- code for loading data
end;
/
The above proc is used for loading data for 10 different table with different structures. So I was trying to implement the generic proc throught which it could be loaded.
Is there any way through which we can create type dynamically as given below, if not what is the best of implementing it?
type my_type is table of i_table_name%rowtype index by pls integer;
Thanks