我一直在使用 ms sql 服务器链接服务器功能连接到 oracle 10g 服务器,但由于某种原因,我无法使用 with 子句。该子句是否仅在 pl/sql 控制台中有效,或者我可以做些什么来使其也适用于链接服务器?
我得到的错误是
Msg 7357, Level 16, State 2, Line 1
Cannot process the object "
编辑:只是想我会补充一点,我正在使用 openquery 来查询链接服务器
SELECT *
FROM OPENQUERY(LINKED_SERVER_ORACLE,
'
WITH assignment_t AS (
SELECT ''1x'' ID, 2 type_id, 554 assign_id FROM dual UNION ALL
SELECT ''1x'', 3, 664 FROM dual UNION ALL
SELECT ''2x'', 2, 919 FROM dual UNION ALL
SELECT ''2x'', 4, 514 FROM dual
), type_t AS (
SELECT 1 type_id, DATE ''2009-01-01'' create_date FROM dual UNION ALL
SELECT 2, DATE ''2009-01-01'' FROM dual UNION ALL
SELECT 3, DATE ''2009-01-03'' FROM dual UNION ALL
SELECT 4, DATE ''2009-01-04'' FROM dual
)
SELECT DISTINCT a.*
FROM assignment_t a
JOIN type_t t ON (a.type_id = t.type_id)
'
) AS QUERY
谢谢