1

如何在行不存在的情况下将数据插入链接服务器(oracle)?

employee如果employeecode该表中尚不存在,我想插入该表

INSERT INTO OPENQUERY(ORACLEX,
  'SELECT EMPCODE, EMPNAME FROM AX.EMPLOYEE') -- I want a where clause here

Select EID, ENAME FROM EMPDATA
4

1 回答 1

3

您实际上可能需要从表中读取两次

   INSERT INTO OPENQUERY(ORACLEX,
  'SELECT EMPCODE, EMPNAME FROM AX.EMPLOYEE') -- I want a where clause here
   Select D.EID, D.ENAME
     FROM EMPDATA D
LEFT JOIN OPENQUERY(ORACLEX,
  'SELECT EMPCODE, EMPNAME FROM AX.EMPLOYEE') OQ ON OQ.EMPCODE = D.EID
    WHERE QQ.EMPCODE IS NULL;
于 2012-11-15T11:44:29.560 回答