ORAOCI9 Stage INSERTing Twice - unique constraint violated

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
smuppidi
Premium Member
Premium Member
Posts: 11
Joined: Fri Mar 17, 2006 9:00 am

ORAOCI9 Stage INSERTing Twice - unique constraint violated

Post by smuppidi »

Hi All,

8x SERVER
STAGE - ORAOCI9

When inserting records into the taget oracle table (which is truncated) job throws warning messages of "unique constraint (UK) violated".But the data being inserted DO NOT have any Duplicates on UK.

The reason this is happening is becuase of the execution of INSERT statement twice by the Target oracle stage.
The log shows something like below-

11:30:45 AM 7/14/2009 JobName.StageName Using NLS map UTF8
11:30:45 AM 7/14/2009 JobName.StageName Using NLS map UTF8
11:30:46 AM 7/14/2009 JobName.StageName INSERT INTO TABLEX (A, B, c) VALUES (SEQ.NEXTVAL,:1,:2)
11:30:46 AM 7/14/2009 JobName.StageName INSERT INTO TABLEX (A, B, c) VALUES (SEQ.NEXTVAL,:1,:2)

There is onle ONE INSERT (custom SQL statement) in my ORAOCI9 target stage.Why would it execute the INSERT twice?
Has anyone encountered this before? Please advice.

Thanks,
Satish.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Never seen any such thing. What 'update action' are you using? How many links are going into the stage?
-craig

"You can never have too many knives" -- Logan Nine Fingers
smuppidi
Premium Member
Premium Member
Posts: 11
Joined: Fri Mar 17, 2006 9:00 am

Post by smuppidi »

chulett wrote:Never seen any such thing. What 'update action' are you using? How many links are going into the stage?
It is a "Custom SQL Statement" like below -

INSERT INTO TABLEX (A, B, c) VALUES (SEQ.NEXTVAL,:1,:2)
smuppidi
Premium Member
Premium Member
Posts: 11
Joined: Fri Mar 17, 2006 9:00 am

Post by smuppidi »

...And only ONE link.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Very odd. First suggestion would be to delete that stage from the job and set it back up again from scratch, see if that fixes whatever is going on.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Your lines from log appear twice. Is it how it appears in the job log?

You can do the following to analyse
1.) Try disabling the unique constraint and check the result after the run.
2.) Include a constraint to pass only one row from source and check the result
3.) Redirect the same output to sequential file and check its contents
4.) Truncate the table manually before run and re-run the job
Post Reply