View previous topic :: View next topic
|
Author |
Message |
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Hi
I have a DB2 table . I want to update a column based on the value of a working-storage variable.
ie. If ws-var = "A", Set column = 'B'
else Set column = 'C'
Can I do this within a single update?..
Thanks,
Arun |
|
Back to top |
|
|
Srihari Gonugunta
Active User
Joined: 14 Sep 2007 Posts: 295 Location: Singapore
|
|
|
|
Handle this in your program
IF WS-VAR='A'
WS-COL='B'
ELSE
WS-COL='C'
ENDIF
and always update the table with value from WS-COL. So you will end up with single update statement. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Hi,
Thanks for your reply. I am doing in that way only...
Thanks,
Arun |
|
Back to top |
|
|
|