|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
[Help] Conditional ESQL UPDATE Statement |
« View previous topic :: View next topic » |
Author |
Message
|
arthasdk |
Posted: Thu Aug 04, 2016 9:40 am Post subject: [Help] Conditional ESQL UPDATE Statement |
|
|
Newbie
Joined: 04 Aug 2016 Posts: 3
|
Hi Guys,
I wanted to something like :
Update {DB}.{Schema}.{Table} T SET
A=<ValA>
B=<ValB>
C=<ValC>
Where
D=<ValD>
AND E=<ValE>
AND F=<ValF>;
This works fine except when ValF is NULL (which can be NULL).
I also want the NULL part to be processed, example : When ValF is NULL then I want the row with F =NULL , D = ValD, E = ValE to be updated.
Now, ValF can be NULL / Not NULL, so is there a way of handling the NULL Part except writing the whole update statement using IF/Else or Dynamic SQL using PASSTHRU.
Environment Details :
WMB : v7.x
Database : Db2 10.5.x
Thanks in advance for any advice!!
Last edited by arthasdk on Thu Aug 04, 2016 10:00 am; edited 1 time in total |
|
Back to top |
|
 |
Armageddon123 |
Posted: Thu Aug 04, 2016 9:52 am Post subject: |
|
|
Acolyte
Joined: 11 Feb 2014 Posts: 61
|
|
Back to top |
|
 |
arthasdk |
Posted: Thu Aug 04, 2016 10:02 am Post subject: |
|
|
Newbie
Joined: 04 Aug 2016 Posts: 3
|
Will COALESCE work if say, I want to update the record with (D,E,F) with values (<ValD>, <ValE>, NULL) ? |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|