Oracle官方论坛关于DBLink problem ORA-22992的讨论
2008-08-07 18:08
323 查看
我做了一下整理,最终那句是最后的答案,相信不用怎么翻译大家都应该能够看懂说些什么,这一点可是搞IT所必须的。
don't know if this is related, but we were also having a problem that was causing the ORA-22992 error, and the solution turned out to be surprisingly simple. A full day of searching the web didn't turn up this answer, but then one of our DBAs accidentally stumbled over something buried in some Oracle documentation that provided the answer.
We have a database table that contains a couple primary key fields (a varchar and an integer), plus a BLOB that holds Word documents. One of our programs needs to be able to connect to a remote Oracle instance and copy Word documents based on certain primary keys.
Our code first attempted to do that like this:
insert into [local Word doc table] ([key column1], [key column 2], [blob column])
values ('[key 1 literal]', [key 2 literal],
(select [blob column] from [Word doc table]@[remote instance]
where [keys = remote keys])
Attempting to execute that was giving us the "cannot use LOB locators selected from remote tables" error.
The documentation that our DBA turned up included a bunch of SQL examples of using remote BLOBs which he thought would be helpful. But what provided the solution was the sentence following the SQL examples: "In statements structured like the preceding examples, only standalone LOB columns are allowed in the select list".
I took that to mean that if you're going to access a BLOB on a remote database, then that BLOB column has to be the ONLY column you're referencing. So I broke our program's SQL up into this:
insert into [local Word doc table] ([key 1 col], [key 2 col], [blob col]) values
('[key 1]', [key 2], NULL)
update [local Word doc table] set [blob col] =
(select [blob col] from [Word doc table]@[remote instance]
where [keys = remote keys])
where [keys = local keys]
I was amazed to find that the above works like a charm. We've got a 100 meg Word document going from one Oracle instance to the other with no problem.
Since doing a Google search on "cannot use LOB locators selected from remote tables" turns this page up near the top of its list of links, I'm hoping that by posting this I can save another programmer somewhere the two or three days of banging your head against the screen that I just went though.
don't know if this is related, but we were also having a problem that was causing the ORA-22992 error, and the solution turned out to be surprisingly simple. A full day of searching the web didn't turn up this answer, but then one of our DBAs accidentally stumbled over something buried in some Oracle documentation that provided the answer.
We have a database table that contains a couple primary key fields (a varchar and an integer), plus a BLOB that holds Word documents. One of our programs needs to be able to connect to a remote Oracle instance and copy Word documents based on certain primary keys.
Our code first attempted to do that like this:
insert into [local Word doc table] ([key column1], [key column 2], [blob column])
values ('[key 1 literal]', [key 2 literal],
(select [blob column] from [Word doc table]@[remote instance]
where [keys = remote keys])
Attempting to execute that was giving us the "cannot use LOB locators selected from remote tables" error.
The documentation that our DBA turned up included a bunch of SQL examples of using remote BLOBs which he thought would be helpful. But what provided the solution was the sentence following the SQL examples: "In statements structured like the preceding examples, only standalone LOB columns are allowed in the select list".
I took that to mean that if you're going to access a BLOB on a remote database, then that BLOB column has to be the ONLY column you're referencing. So I broke our program's SQL up into this:
insert into [local Word doc table] ([key 1 col], [key 2 col], [blob col]) values
('[key 1]', [key 2], NULL)
update [local Word doc table] set [blob col] =
(select [blob col] from [Word doc table]@[remote instance]
where [keys = remote keys])
where [keys = local keys]
I was amazed to find that the above works like a charm. We've got a 100 meg Word document going from one Oracle instance to the other with no problem.
Since doing a Google search on "cannot use LOB locators selected from remote tables" turns this page up near the top of its list of links, I'm hoping that by posting this I can save another programmer somewhere the two or three days of banging your head against the screen that I just went though.
相关文章推荐
- 关于oracle与mysql官方jdbc的一些区别
- oracle通过DBLink访问远程数据库的LOB字段报ORA-22992的解决方法
- oracle关于加锁的讨论
- 小小的讨论,关于10分钟和十分钟<转自经典论坛>
- 【Wonder原创】关于MSSQL通过DBLink访问Oracle问题
- oracle通过DBLink访问远程数据库的LOB字段报ORA-22992的解决方法
- 关于oracle dblink的知识。
- C#.NET执行Oracle DBLink关于“ORA-02041: 客户数据库未开始一个事务处理”
- 关于创建oracle dblink 过程
- 关于Oracle中表空间的一些讨论
- 关于创建oracle dblink 过程的几点心得吧
- Oracle 官方给出声明——对于dblink产生影响
- Oracle通过DBLink操作数据表,报错“ORA-22992:无法使用从远程表选择的lob定位器”
- 关于UI开发(总结一些技术和一些论坛牛人讨论)
- [转载Oracle官方中文博客]关于RunQ过高引起的latch等待问题
- 转: 关于UI开发(总结一些技术和一些论坛牛人讨论)
- 关于创建oracle dblink 过程及使用
- 关于SQL Server/oracle将一列的多行内容拼接成一行的问题讨论
- oracle ora-22992 通过DBLINK 访问远程CLOB表问题
- ITeye论坛关于权限控制的讨论