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. |