What is cause of ORA-38104 error on SQL merge?

后端 未结 2 1795
盖世英雄少女心
盖世英雄少女心 2021-01-06 09:52

I have a code like this

MERGE INTO target_table tgt
USING source_table src
on(tgt.c1=src.c1)
WHEN MATCHED THEN
UPDATE SET tgt.c1=src.c2

I g

2条回答
  •  执念已碎
    2021-01-06 10:18

    You can exploit some workarounds for ORA-38104, which seem to work up until Oracle 18c, including this one, where you'd wrap your columns in a row value expression that contains an additional dummy expression:

    MERGE INTO target_table tgt
    USING source_table src
    ON ((tgt.c1, 'dummy') = ((src.c1, 'dummy')))
    WHEN MATCHED THEN
    UPDATE SET tgt.c1=src.c2
    

提交回复
热议问题