免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1771 | 回复: 1
打印 上一主题 下一主题

关于dblink [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-05-09 19:55 |只看该作者 |倒序浏览
create  PUBLIC  database link cbsdblink
  connect to Tcheck identified by Tcheck
  using '(DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.1.1)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = ODS)
      (INSTANCE_NAME = cisg2)
    )
  )';

select * from fccont@cbsdblink a left join fcpol@cbsdblink b on a.innercontno = b.innercontno
                                  and b.agentcode not in  (select t.CalBatchNo from FSInsurePrem@cbsdblink t)

报这个错误
ORA-00904: "A"."INNERCONTNO": invalid identifier
ORA-02063: 紧接着 line (起自 CBSDBLINK)

select a.*
   from fccont@cbsdblink  a
   left join fcpol@cbsdblink  b on b.innercontno = a.innercontno
                    and b.innercontno not in
                        ('14', '52', '54', '55')

select * from fccont@cbsdblink a

select t.CalBatchNo from FSInsurePrem@cbsdblink

上面三句sql查都是没有问题的,不知是什么原因,但总觉得很有可能与dblink的配置有关,望各位大侠帮帮忙?

论坛徽章:
0
2 [报告]
发表于 2009-05-10 16:09 |只看该作者
select * from fccont@cbsdblink a left join fcpol@cbsdblink b on a.innercontno = b.innercontno
                                  and b.agentcode not in  (select t.CalBatchNo from FSInsurePrem@cbsdblink t)

中的select * 是否有岐义? 因为a和b中都有innercontno

试一下

select a.* from fccont@cbsdblink a left join fcpol@cbsdblink b on a.innercontno = b.innercontno
                                  and b.agentcode not in  (select t.CalBatchNo from FSInsurePrem@cbsdblink t)
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP