On Oct 20, 1:46 pm, Arun Srinivasan <arunro... at (no spam) gmail.com> wrote:
merge into arun.test1 a
using arun.test2 b
on a.a=b.a
when matched then delete
when not matched then update set a = 99;
[IBM][CLI Driver][DB2/LINUXX8664] SQL0104N An unexpected token "when
not matched then" was found following "matched then delete". Expected
tokens may include: "<merge_when_spec1>". SQLSTATE=42601
2 rows merged because of ERROR.
I found each of the syntax diagrams containing both 'WHEN MATCHED' and
'WHEN NOT MATCHED', now, this is mind boggling!!!!!!!!!!!!!!!!!!!!!!!!!
Sorry, it was because i used something but 'insert or signal in the
WHEN NOT MATCHED clause....
http://bytes.com/topic/db2/answers/183732-merge-syntax-error
.... so you're all good?