Unix Technical Forum

cli load question

This is a discussion on cli load question within the DB2 forums, part of the Database Server Software category; --> We are using cli bulk loader to load data into db2. In some cases the rows get rejected and ...


Go Back   Unix Technical Forum > Database Server Software > DB2

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-27-2008, 08:12 AM
Sumanth
 
Posts: n/a
Default cli load question

We are using cli bulk loader to load data into db2. In some cases the rows
get rejected and this is flagged as a warning
allowing the program to continue.

Is there any way to trap this warning, I read the use of "EXCEPTION TABLE"
but that is limited to only unique index
violations and not constraint related errors.
How do we handle or capture the rejected records in an elegant way?

Thanks in advance,
Sumanth


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-27-2008, 08:12 AM
Phil Sherman
 
Posts: n/a
Default Re: cli load question

I don't know how "elegant" you want the capture to be but an easy way is
to pipe the output of LOAD to a file and parse the errors out of it.
These errors refer to records in a file which are not something handled
in the database. Most of the errors I've seen like this are formatting
errors - alphabetic data in a numeric column. A frequent cause of this
is a character column that contains an apostrophe - the same character
used as a delimiter for character data.

Constraint related errors are a different issue. A table that contains
constraints that is the target of a LOAD operation will be placed in
"check pending" state. You need to run the SET INTEGRITY command against
the table to locate and handle these errors. Set integrity has an option
to delete the rows failing constraint checks and move them to a work
table. There's no reason this couldn't be the same table that you used
for the "exception table" during LOAD processing.

Unfortunately, when there are multiple check constraints, there's no way
to tell which one caused the row to be deleted from the LOAD target
table. I usually try to scrub data before loading rather than have LOAD
catch all of the errors.


Phil Sherman



Sumanth wrote:
> We are using cli bulk loader to load data into db2. In some cases the rows
> get rejected and this is flagged as a warning
> allowing the program to continue.
>
> Is there any way to trap this warning, I read the use of "EXCEPTION TABLE"
> but that is limited to only unique index
> violations and not constraint related errors.
> How do we handle or capture the rejected records in an elegant way?
>
> Thanks in advance,
> Sumanth
>
>

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
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
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 06:01 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com