dbTalk Databases Forums  

While loading how can we skip the new colum data?

ibm.software.db2.mvs ibm.software.db2.mvs


Discuss While loading how can we skip the new colum data? in the ibm.software.db2.mvs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
pgkrish@yahoo.com
 
Posts: n/a

Default While loading how can we skip the new colum data? - 06-30-2009 , 12:26 AM






Hi,

The target table has one extra column. how can I skip that column while loading?

Reply With Quote
  #2  
Old   
momi.sabag@gmail.com
 
Posts: n/a

Default Re: While loading how can we skip the new colum data? - 06-30-2009 , 06:04 AM






Hi

are you loading using the load utility?
if so, I can only think of:
1) try no to specify the column name in the into clause, maybe db2 will pick the default or null for that column
2) if 1 does not work, try loading a constant value into that column (or null)

one of them should work

Reply With Quote
  #3  
Old   
sdasinger@monlife.com
 
Posts: n/a

Default Re: While loading how can we skip the new colum data? - 06-30-2009 , 06:34 AM



pgkrish, Assuming your data is in standard DSNTIAUL format, you need to add Load cards to let DB2 know what columns in the table to add what data from the file. (This is similar in concept to an Insert with fewer values than columns needing a column list).

The easiest way to generate the Load cards is to unload the table. The table can be empty or you can use FETCH FIRST 1 ROW ONLY as you don't care about the data. All Utilities and programs that unload data can generate the Load cards.

Once you have this file, you will need to edit it and remove the column that does not have data in the file (and this column has to be either Nullable or have a Default value).

You only need the list of columns and their position in the file. You would copy this file after the "INTO table-name" parameter of the Load.

If your data is NOT in DSNTIAUL format (but is fixed length), you may need other modifications to the Load card file. You might need to change the POSITION start / end values to match the location in the data file. If you have numbers that are 'readable' (ex. 123.92) instead of binary or packed decimal, you will need to add the EXTERNAL keyword for these columns.

Reply With Quote
  #4  
Old   
Todd Burch
 
Posts: n/a

Default Re: While loading how can we skip the new colum data? - 07-06-2009 , 09:22 PM



You could create a dummy table that does not have the column, load it, then INSERT from SELECT to the target table.

Todd

Reply With Quote
Reply




Thread Tools
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.