Update existing or insert new rows

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
venugopal81
Participant
Posts: 49
Joined: Sat Mar 26, 2005 12:19 am

Update existing or insert new rows

Post by venugopal81 »

Hi All,

We have extracted data from SAP-BW and loaded data in to DB2 database server. We using update existing or insert new rows option.
But problem is records or not updated, but records inserted.

Can you please suggest me on this....

Thanks & regards
venu
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

This usually occurs when you do not have indices defined correctly; i.e. there is a difference between the keys used in the Db and those used in the lookup for the insert/update.
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

I will say it is more to do with the keys defined in the target cols than in the db.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Of course, if every record was new - that is, not already in the target table - you would also (correctly) observe no records being updated and all records inserted.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

When you get right down to it, it's not about 'new' versus 'old' but - based on the fields you marked as keys - where any rows in the target database actually updated? When zero rows are updated that triggers the call to the insert... which can still fail because the 'real' keys already exist on another record or in another unique index.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply