Hello all,
In one of my jobs, I am using Insert new or update existing rows. In that I want to move a field from my input stage only while inserting new rows. I want to keep the old value when it is updating an existing row. How can I do that?
Any help is much appreciated.
Regards,
Aravind.
Keeping the old value on update
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 19
- Joined: Fri Apr 02, 2004 10:13 am
Copy the sql generated by the "Insert new or update Existing rows" option.
Then change to "User defined sql". Paste the sql from above but make the changes to the update part to use the columns from the table instead of the host variables. This same mechanism can be used even if you want to add to an existing numeric column while updating.
Then change to "User defined sql". Paste the sql from above but make the changes to the update part to use the columns from the table instead of the host variables. This same mechanism can be used even if you want to add to an existing numeric column while updating.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
The option is on the General page of the Inputs tab.
Better design is to segregate the rows to be inserted and updated so that one link can handle "insert new rows only" and the other link can handle "update existing rows only". In this case, preserve the original value in a column simply by not delivering that column to the "update" link.
Better design is to segregate the rows to be inserted and updated so that one link can handle "insert new rows only" and the other link can handle "update existing rows only". In this case, preserve the original value in a column simply by not delivering that column to the "update" link.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.