从Oracle到SQL Server的链接无法创建视图

时间:2012-08-29 19:32:04

标签: sql-server database oracle10g database-link

使用oracle 10我有一个到sql server的链接。我有一个查询(下面),运行正常,就像一个选择的规则,但当我用它来创建一个视图(视图是成功创建,但当我尝试在sql开发人员的视图中查看数据)我得到一个< / p>

数据库&#39; linkname&#39;在此上下文中不支持ROWID

问题是我将一个表中的多行组合成多列的子选择吗?

  SELECT
    upper(cus."cus_last_name")  AS lname,
    upper(cus."cus_first_name") AS fname,
    upper(cus."cus_initial")    AS minitial,
    upper(cus."maiden_name")   AS olname,
    pt."cus_dob"               AS dob,
    pt."cus_id"              AS id,
    (
      SELECT
        cus_inst_key."cus_key_value"
      FROM
        "cus_inst_key"@linkname cus_inst_key
      WHERE
        cus_inst_key."cus_id"             = cus."cus_id"
      AND cus_inst_key."cus_key_cd"       = 1
    ) AS CUSALTID,
    (
      SELECT
        pcus_inst_key."cus_key_value"
      FROM
        "cus_inst_key"@linkname cus_inst_key
      WHERE
        cus_inst_key."cus_id"             = cus."cus_id"
      AND cus_inst_key."cus_key_cd"       = 2
     ) AS CUSALTID2,
    (
      SELECT
        cus_inst_key."cus_key_value"
      FROM
        "cus_inst_key"@linkname cus_inst_key
      WHERE
        cus_inst_key."cus_id"             = cus."cus_id"
      AND cus_inst_key."cus_key_cd"       = 3
    ) AS CUSALTID3,
    (
      SELECT
        cus_inst_key."cus_key_value"
      FROM
        "cus_inst_key"@linkname cus_inst_key
      WHERE
        cus_inst_key."cus_id"             = cus."cus_id"
      AND cus_inst_key."cus_key_cd"       = 4
    ) AS CUSALTID4
  FROM
    "cus"@linkname cus;

感谢您的帮助。


视图实际上已创建好了我出于某种原因无法使用sql developer中的数据选项卡。

0 个答案:

没有答案