uprocedure p_process
(in_list_rec list_rec, in_parent_list id_tt) is
u v_execute_tx varchar2(32000);
ubegin
u v_execute_tx:=
u 'declare '||
u ' type rows_t is table of '
u
||in_list_rec.table_tx||'%rowtype;'||
u ...
u 'begin '||
u '
select * bulk collect into v_rows '||
u '
from '||in_list_rec.table_tx||' t where '||in_list_rec.fk_tx||
u '
in (select * from table (cast (:1 as id_tt)));'||
u '
if v_rows.count()=0 then return; end if;'||
u '
for i in v_rows.first..v_rows.last loop '||
u '
select object_Seq.nextval into v_new_id from dual;'||
u '
v_rows(i).'||in_list_rec.pk_tx||':=v_new_id;'||
u '
v_rows(i).'||in_list_rec.fk_tx||
u '
:=clone_pkg.v_Pair_t(v_rows(i).'||in_list_rec.fk_tx||');'||
u ...
u '
end loop;'||
u ...
u 'end;';
u execute immediate v_execute_tx using
in_parent_list;
uend;