Updating a specific column

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
Diya
Participant
Posts: 38
Joined: Fri Feb 17, 2006 7:02 am

Updating a specific column

Post by Diya »

I have a job which inserts/updates data in a table.

I have one more job in which I want to update ONLY ONE column of that table.(The second job is only meant for this purpose)

Im using a dynamic RDBMS stage to load the table and it is not allowing me to update only one column as it is asking for key columns.But if I provide key columns I dont want to update them and since there is no source 4 those key columns it will result in inserting null which is not acceptable.

Can anyone help me on this?

Thanks,
Diya
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

If you look at the generated SQL then you will see that it will only do an UPDATE ... WHERE KEY1 = ...

You should be safe.
Mamu Kim
meena
Participant
Posts: 430
Joined: Tue Sep 13, 2005 12:17 pm

Post by meena »

Hi Diya,

You need atleast one key to update.Without a key I think it is difficult to update.
By selecting a key your going to update your required column based on the key match.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Of course it's asking for key - it wants to know in which row(s) to perform the update. If you want to update every row, fake it - specify any column as "key" - it ends up in the WHERE clause - and a condition that is always true (for example WHERE key = key). You may, depending upon the stage type, require user-defined SQL.
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