I am trying to update D_WINTEL_HEALTH
table and below is the query i am using
UPDATE D_WINTEL_HEALTH A
SET A.HEALTH = 7
FROM D_WINTEL_HEALTH A JOIN D_REPORTER_STATUS B ON A.HOST = B.HOST
WHERE B.ALERTKEY = 'kph_netport_xlzc_ilo' AND
B.SEVERITY = 0 AND
A.HEALTH <> 0
I also tried with one more query:
UPDATE D_WINTEL_HEALTH A SET A.HEALTH = 7
FROM (Select D_WINTEL_HEALTH A JOIN D_REPORTER_STATUS B
ON lower(A.HOST) = lower(B.HOST)) s
WHERE s.ALERTKEY = 'kph_netport_xlzc_ilo' AND s.SEVERITY = 0 AND s.HEALTH <> 0
But both of them return below error:
[UPDATE - 0 row(s), 0.000 secs] [Error Code: -104, SQL State: 42601] DB2 SQL Error: SQLCODE=-104, SQLSTATE=42601, SQLERRMC=FROM;A SET A.HEALTH = 7 ;LEFT_BRACKET, DRIVER=4.15.82
tested the select query which works fine, not sure what is the issue, is it different in IBM DB2.