Hi All
I have an update statement in which i am using a CTE (Common table Expression), but when i try to run its giving me syntax error. is CTE not supported inside update statements?. My db is Db2 V9.5 on Aix
My query is like the below.
update db2.tablename set col1=123 , col2='P'
where col3 in
( with temp 1 as (select a.col1,b.col2 from tableA A, tableB B where .....some conditions)
,
temp2 as (select a.col1 from tableA where ...some different conditions here)
select col1 from temp1 where temp1.col1=temp2.col1 where ....
)
SQL0104N An unexpected token "as" was found following "ol3 IN ( with temp1".
Expected tokens may include: "JOIN". SQLSTATE=42601
can some one please tell me why i am getting this error?