1

此合并语句引发 ORA-00905:missing keyword 异常。可能是什么问题?WHEN MATCHED 分支的东西?

MERGE INTO WORKERPROJECT TARGET
USING (SELECT distinct
               w.worker_id,
               w.worker_type,
               w.project_id worker_project_id, 
               p.project_id project_project_id,
               p.dedicated_project_leader,
               p.dedicated_lead_developer,
               p.dedicated_lead_consultant,
               p.dedicated_supervisor
       from WORKER w 
       join PROJECT p on w.project_id = p.project_id
      ) SOURCE
   ON (TARGET.FK_worker_id=SOURCE.WORKER_ID)
 WHEN MATCHED THEN INSERT (TARGET.FK_WORKER_ID, TARGET.FK_PROJECT_ID,TARGET.IS_ACTIVE,POSITION) 
  VALUES (SOURCE.WORKER_ID,SOURCE.worker_project_id,'IS_ACTIVE',SOURCE.worker_type);
4

1 回答 1

2

根据http://www.oracle-base.com/articles/10g/merge-enhancements-10g.php

您只能在不匹配时进行插入。

于 2013-01-22T09:51:04.420 回答