问题描述
我有一个SQL语句可以自己运行,并通过db链接获取结果。但是,如果我想在同一select语句之前使用 “create table….as ..” 或 “insert in入…” 将结果集放入表中,则会出现ORA-22992错误。是什么原因造成的?
SQL语句如下:
表 “a” 和 “c” 没有LOB字段,表 “b” 有一个字段 “Ldesc”,它是CLOB,但它不在选择列表中。
本地版本:
甲骨文数据库11g企业版11.2.0.2.0-64bit生产
远程版本:
甲骨文数据库11g企业版11.2.0.2.0-64bit生产
SQL语句如下:
Select a.m, a.n, a.o, a.p, b.q, b.r, b.s, c.t, c.u,c.v From a@remote a left join b@remote b on b.m=a.m and b.n=a.n Left join c@remote c on c.m=a.m and c.m=a.n Where a.yr=2019 a.class=1 order by a.m复制
表 “a” 和 “c” 没有LOB字段,表 “b” 有一个字段 “Ldesc”,它是CLOB,但它不在选择列表中。
本地版本:
甲骨文数据库11g企业版11.2.0.2.0-64bit生产
远程版本:
甲骨文数据库11g企业版11.2.0.2.0-64bit生产
专家解答
我怀疑这是一个ANSI加入转换问题。转换为经典加入对我有用:
加入...使用形式的查询工作在19c,所以可能有一个补丁可用。
create table t1 ( c1 int, c2 clob ); create table t2 ( c1 int, c2 clob ); insert into t1 with rws as ( select level x from dual connect by level <= 10 ) select x, 'clob data' from rws; insert into t2 select * from t1; create table tmpt as select c1 from t1@loopback t1 join t2@loopback t2 using ( c1 ); ORA-22992: cannot use LOB locators selected from remote tables create table tmpt as select t1.c1 from t1@loopback t1, t2@loopback t2 where t1.c1 = t2.c1; select * from tmpt; C1 1 2 3 4 5 6 7 8 9 10复制
加入...使用形式的查询工作在19c,所以可能有一个补丁可用。
文章转载自ASKTOM,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。