I am trying to create an update subsquery for the condition:
agent region region-ovrd-ind terminate-date
123 A Y 99999999 (active)
123 A Y 99999999 (active)
123 B N 20080101 (terminate)
123 B N 20080112 (terminate)
when the region-ovrd-id = Y & terminate-date is 9999999, then all the region should be same. In this case, update region to value of A & region-ovrd-id to Y
my update sql is:
Update ACR B
Set B.region_NUMBER = A.region_NUMBER , B.region_OVRD_I ND = 'Y'
From ACR B
WHERE B.region_NUMBER NOT IN
(select A.region_NUMBER from ACR A
where B.AGENT_ID = A.AGENT_ID
AND A.REGION_OVRD_I ND = 'Y' AND
A.TERMINATION_D TE = 99999999)
I am getting this error:
error
42601(-104)[IBM][CLI Driver][DB2/NT] SQL0104N An unexpected token "CURRENT_TIMEST AMP" was found following "DATE, B.TIME_STAMP =". Expected tokens may include: "(". SQLSTATE=42601
(0.02 secs)
Appreciate any suggestions. Thanks.
agent region region-ovrd-ind terminate-date
123 A Y 99999999 (active)
123 A Y 99999999 (active)
123 B N 20080101 (terminate)
123 B N 20080112 (terminate)
when the region-ovrd-id = Y & terminate-date is 9999999, then all the region should be same. In this case, update region to value of A & region-ovrd-id to Y
my update sql is:
Update ACR B
Set B.region_NUMBER = A.region_NUMBER , B.region_OVRD_I ND = 'Y'
From ACR B
WHERE B.region_NUMBER NOT IN
(select A.region_NUMBER from ACR A
where B.AGENT_ID = A.AGENT_ID
AND A.REGION_OVRD_I ND = 'Y' AND
A.TERMINATION_D TE = 99999999)
I am getting this error:
error
42601(-104)[IBM][CLI Driver][DB2/NT] SQL0104N An unexpected token "CURRENT_TIMEST AMP" was found following "DATE, B.TIME_STAMP =". Expected tokens may include: "(". SQLSTATE=42601
(0.02 secs)
Appreciate any suggestions. Thanks.
Comment