create procedure db2ods.load_archive_stsomod()
language sql
p1: begin
for v_tsn as C1 cursor with hold for
select tso_split_no, count(*) as cnt
from fedpdb2.archive_stsomod group by tso_split_no
do
insert into db2ods.archive_stsomod
select * from fedpdb2.archive_stsomod
where tso_split_no = v_tsn.tso_split_no;
commit;
end for ;
end p1@
commit @