Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How suppress warnings in load message file

Status
Not open for further replies.

ddiamond

Programmer
Apr 22, 2005
918
US
I'm attempting to load a table from a comma delimited file using the following statement:

Code:
load from c:\cm_claim_master.txt of del  
messages c:\cm_claim_master.log
replace into geniusdata.cm_claim_master;

Unfortionately, cm_claim_master.log is filling up with thousands warning messages that I don't care about:

SQL3125W The character data in row "1" and column "13" was truncated because
the data is longer than the target database column.

I want db2 to truncate my string fields if they are too large, but I don't want to see 100,000 warnings in my log file. I tried using "warningcount 50" but then the load stops after the 1st 50 warnings. Is there anyway to tell the load statement to only log errors, not warnings?
 
OK, I've read through all of the help files, and as far as I can tell, it is not possible to suppress warnings, but include other error messages. Can anyone tell me if they agree or disagree?
 
ddiamond,

I can't find anything to make me feel you're wrong here. Do have a bit of supplementary info around load, don't know if it's of use to you?

Does the SUMMARY ONLY option help on the LOAD QUERY command. With Load Summary (rows read, rows skipped, rows loaded, rows rejected, rows deleted, rows committed and number of warnings) are reported.

Not set up to try it at the moment, but sounds like you could give it a go and see what goes in your message file.

Another alternative I could suggest is to use an exception table, rather than a file which fills up with warnings. This is a user created table that reflects the definition of the table being loaded, and includes two additional columns: Timestamp and Message(CLOB). Rows that create an error condition are load are copied here by the Load utility. Any row that is in violation of a unique index or a primary key index is copied. May be worth trying, as the spec only mentions errors, as opposed to warnings.

Appreciate this doesn't answer your question but may give you some alternative approaches?

Thanks
Greg
 
Thanks Greg,

I'll give your suggestions a try.

- Dan
 
ddiamond,
I had a read through the Data utility manual which was mentioned in your other thread, and there does not appear to be anything in the load command that can control the output of errors as opposed to warnings. I did get the impression from reading that section that the output of those SQLnnnn type messages was environmental rather than command specific. Is there anywhere in the DB2 command centre envirnoment where you can specify that you are only interested in errors rather than warnings or notifiy messages?

Marc
 
Marc,

That is an interesting thought. I'll look into it and see what I can find. I actually don't mind all of the warning messages because I can write a simple script to strip them out. The problem is that it kills the performance of DB2 writing out a message file that large.

- Dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top