This answer上SO一个问题说是否可以从远程Oracle数据库读取CLOB?
... you can read a LONG from a remote database, but you can't read a CLOB
我没有在互联网上找到这事,是真的吗?任何文件或引用此将有所帮助。
This answer上SO一个问题说是否可以从远程Oracle数据库读取CLOB?
... you can read a LONG from a remote database, but you can't read a CLOB
我没有在互联网上找到这事,是真的吗?任何文件或引用此将有所帮助。
答案是在一定的范围内是正确的,对于在DB链接简单的SELECT语句,你会得到这样的错误:
ORA-22992: cannot use LOB locators selected from remote tables.
从错误手册:
Cause: A remote LOB column cannot be referenced.
Action: Remove references to LOBs in remote tables.
我也无法在此找到明确的文档......但我们在数据仓库中遇到了同样的问题。但是,有几种解决方法可用,例如pulling the data over or creating a view。
昨天我有同样的麻烦。这是我的解决方案:在romote表上创建一个romote视图,当CLOB列出现时,使用to_char(),比如to_char(col2)。然后你可以从视图中选择数据。这可能不是一个好的解决方案,但它有效。
如果两个DB计划是在同一个Oracle实例,您可以使用以下解决方法:
select (select <columnName> from dual) <columnName> from <table>@<link>
这将返回一样的,如果你访问本地LOB列。
由于一些奇怪的原因,它在视图中不起作用,但在我的情况下导致解决方案。谢谢! – CsBalazsHungary 2016-06-06 13:31:16
@Peter Ilfrich:试图超过4000个字节访问任何的CLOB时不抛出异常的?
这是一个稍微高估,但它意味着你可以安全地通过dblink拉回小clobs(< 4000)。
select [email protected]<link>((select <columnName> from [email protected]<link>), 4000, 1)
from <table>@<link>
where [email protected]<link>((select <columnName> from [email protected]<link>)) <= 4000;
在DBLINK 读一CLOB(或BLOB)是可能的这个PL/SQL包:
https://github.com/HowdPrescott/Lob_Over_DBLink
感谢您的链接! – Moeb 2010-08-30 09:20:18