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 > Loading data into tables with new columns added in between.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-12-09, 18:38
db2pro db2pro is offline
Banned
 
Join Date: Mar 2009
Posts: 36
Loading data into tables with new columns added in between.

Hi All,

I have some tables with the data. I need to add 4 to 8 columns in between to each table. All these table consists of data. Not much data but has some data and I need to export all the data from all the fileds from the inital structure of the table and then drop the table and recreate with adding the new columns in middle and then again load the data exported from the initial table to their repective columns..

I have exported the data in the following formats

db2 "export to xxx.del of del select * from schema.tabname"
db2 "export to xxx.csv of del select * from schema.tabname"
db2 "export to xxx.del of del select col1,col2,col3... from schema.tabname"
db2 "export to xxx.csv of del select col1,col2,col3... from schema.tabname"

can anyone please help me now, how to load this exported data into table with newly added columns. all added columns are nullable.

Or can anyone suggest me the best method or approach to do this task...

Thanks for ur help in advance..

DB2 Version: 9.5

OS Level : AIX 5.3
Reply With Quote
  #2 (permalink)  
Old 08-12-09, 19:12
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Why do you think you need to add columns _in the middle_?

Anyway, check the METHOD option of the load command - it allows you to indicate the mapping between the input data and the table columns.
Reply With Quote
  #3 (permalink)  
Old 08-12-09, 21:07
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
Quote:
Originally Posted by n_i
Why do you think you need to add columns _in the middle_?
Didn't you see his handle name?
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
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