regarding peculiar error

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
vijaykumar
Participant
Posts: 228
Joined: Tue Oct 03, 2006 7:08 pm

regarding peculiar error

Post by vijaykumar »

hi gurus,
iam doing join of 2 tables in my source stage.
its compiling and running without any errors, but its not loading in the target database.
plz help me, iam getting warning.
[DataStage][SQL Client][ODBC][Oracle][ODBC][Ora]ORA-00001: unique constraint (SCOTT.SYS_C001342) violated.
plz help me ,

cheers;
vijay
johnthomas
Participant
Posts: 56
Joined: Mon Oct 16, 2006 7:32 am

Post by johnthomas »

This error is because you are Appending data to a table which has the same key values defined in the constraint .If you truncate the target table and load the data this error should not occur
JT
vijaykumar
Participant
Posts: 228
Joined: Tue Oct 03, 2006 7:08 pm

Post by vijaykumar »

Hi gurus,
THANKS VERY MUCH.

i changed my update action to- clear the table and then insert rows.
iam not getting any error.

cheers;
vijay
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

johnthomas wrote:If you truncate the target table and load the data this error should not occur
:shock: I'd be careful about giving advise like this without qualifying it, especially for a newbie. We don't want people going around truncating tables just to solve unique constraint errors... unless, of course, that's appropriate for their particular situation.
vijaykumar wrote:i changed my update action to- clear the table and then insert rows. iam not getting any error.
You do realize why that is, yes? You removed all records from the target table then loaded your set - and there were no duplicates in your source data. Hopefully that's what you intended to happen, each run would entirely replace whatever was there with the current load's data.

It's only a SCOTT table, I know, but still...
-craig

"You can never have too many knives" -- Logan Nine Fingers
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Ouch. I really hope that truncating the target was really what he wanted. Also, clear table and then insert will take a lot of time if target table is huge. You might want to re-consider this approach.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Post Reply