Problem with update existing rows and insert new rows in SQL

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
Venkata Jaggamma
Participant
Posts: 1
Joined: Wed Nov 21, 2007 6:48 am
Location: Chennai

Problem with update existing rows and insert new rows in SQL

Post by Venkata Jaggamma »


Hi,

I am using Dynamic RDBMS Stage to update existing records or insert new records into a target table. The Target database is on SQL Server.

I have observed that there are two statements in the DRS Stage. One is the update statement which tries to update the existing records. Second one is the insert statement which inserts new records.

However, the option does not seem to work when the update statement fails. New records are not getting inserted. When I tried to debug the job, I was able to find out that there is a problem at the DRS stage.

Can anyone let me know why it happens like this ?
Venkata Jaggamma Gundala
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Welcome. :D

First bit of advice would be to avoid the 'combo' Update actions. Best Practice is to evaluate inserts versus updates and use separate links for each action.

Secondly, it's not about the first action 'failing' per se. With an update, it should only execute the insert if the update does not update any records. If it actually fails, as in throws a database error, you are done.

Can you be more specific about the nature of your 'update statement failure'? Or the alleged problem you found 'at the DRS stage'? :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54595
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Re: Problem with update existing rows and insert new rows in

Post by ray.wurlod »

Venkata Jaggamma wrote: When I tried to debug the job, I was able to find out that there is a problem at the DRS stage.

How?
And what is the precise nature of the problem?
Have you had your diagnosis verified by your support provider?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply