If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > problem in transfer of data

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-29-09, 00:20
ashrash ashrash is offline
Registered User
 
Join Date: Aug 2009
Posts: 15
problem in transfer of data

i have one table called admin_master consisting of numbers of data....


another table called admin_master_old consisiitng of old data


now i want to add this old data to exisiitng table admin_master without the loss of current data ,since data is huge how can i transfer data ...?

is it possible with export /import command ?but there are chances i can loose my current data in admin_master....
and, in admin_master one column is genrated always ,so it will be difficult to transfer data .....

please tell me the solution if anyone here knows ..

thank you
Reply With Quote
  #2 (permalink)  
Old 09-29-09, 03:22
Mathew_paul Mathew_paul is offline
Registered User
 
Join Date: Oct 2007
Posts: 200
you can use

import from <filename>.del of del insert_update into admin_master

kindly chk in test envi before doing in prod

regds
Paul
Reply With Quote
  #3 (permalink)  
Old 09-29-09, 05:21
przytula_guy przytula_guy is offline
Registered User
 
Join Date: Apr 2006
Location: Belgium
Posts: 1,159
you could declare a cursor and execute load from cursor
see infocenter for detailed command : load from cursor
__________________
Best Regards, Guy Przytula
Database Software Consultant
DB2 UDB LUW Certified V7-V8-V9-V9.7 DB Admin - Dprop..
Information Server Datastage Certified
http://www.infocura.be
Reply With Quote
  #4 (permalink)  
Old 09-29-09, 05:23
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
Code:
INSERT INTO admin_master(...) SELECT ... FROM admin_master_old
You may want to add a WHERE clause or use a cursor to iterate over the rows in chunks and do some intermediate commits. You should also specify the column lists so that you can handle the generated column, e.g. by omitting it.
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
  #5 (permalink)  
Old 09-29-09, 08:32
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
Reply With Quote
  #6 (permalink)  
Old 09-30-09, 08:41
ashrash ashrash is offline
Registered User
 
Join Date: Aug 2009
Posts: 15
thanks to all guys

yes now its working

db2 cursor technique also working



thanks db2girl

the link contains nice info...
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On