Svenson's  Bulletin Board Forum Index Svenson's Bulletin Board
Bulletin Board for boat building and model airplane building enthusiasts.
 
AlbumAlbum   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

sql for stored proc to copy big tables

 
Post new topic   Reply to topic    Svenson's Bulletin Board Forum Index -> DB2
View previous topic :: View next topic  
Author Message
craig
Site Admin


Joined: 19 Feb 2006
Posts: 40

PostPosted: Wed Nov 29, 2006 2:29 pm    Post subject: sql for stored proc to copy big tables Reply with quote

-- run with db2 -c- -td@ -vf l | at now

connect to prodods1@

drop procedure db2ods.load_archive_stsomod()@

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 @

alter table db2ods.archive_stsomod
activate not logged initially with empty table @
commit @

call db2ods.load_archive_stsomod()@
commit @
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Svenson's Bulletin Board Forum Index -> DB2 All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group