Discussion:
How to log rejected records using import utility?
(too old to reply)
p***@rediffmail.com
2007-10-26 09:59:07 UTC
Permalink
We need to log records that are rejected by the DB2 import utility.
Basically we need an option similar to dumpfile that comes with the LOAD utility.
We cannot use LOAD utility and import is the only option available with us.
sree
2007-10-26 10:34:59 UTC
Permalink
Hi

1. first create an exception table simlar to actual table.
2. make a LOAD script using following syntax

LOAD CLIENT from <file_name_with fullpath> OF ASC Method L ( <column_numbers_for_load> Messages <give_a_filename.log_here_with fullpath> REPLACE INTO <tablename(columnnames))> FOR EXCEPTION <give_an_exception_table_name> NONRECOVERABLE

3. make sure that you specify a log file with fullpath in the LOAD stattemt

all error records will goto the exception table. you will get following info in the log file

For example :-
Number of rows read = 100
Number of rows skipped = 0
Number of rows loaded = 100
Number of rows rejected = 0
Number of rows deleted = 0
Number of rows committed = 100
sree
2007-10-26 10:37:18 UTC
Permalink
IMPORT also gives an option to specify the MSG file

http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp?topic=/com.ibm.db2.udb.doc/core/r0008304.htm
p***@rediffmail.com
2007-10-26 10:45:55 UTC
Permalink
Thanks Sreejith.
But we need to log the complete records that are rejected by import into a file. We cannot use LOAD and the message file will contain only the execution details and not the actual records that were present in the input file.
sree
2007-10-29 02:42:10 UTC
Permalink
Sorry Pankaj

I think the only option is to use LOAD , get error records in an exception table and using EXPORT utility get those error records to a file
Continue reading on narkive:
Search results for 'How to log rejected records using import utility?' (Questions and Answers)
18
replies
Why does everyone use this? Why not google search?
started 2006-05-14 04:04:41 UTC
society & culture
Loading...