今天想要查询一个表中的数据发现没有权限,但是还好有dblink。
但是报错:无法使用远程表选择的LOB定位符
网上查询了下
发现原因是要查询的表中有CLOB字段的数据
提供两种解决办法:
第一种:
如果这个字段不是你想要查的可以去掉这个字段进行查询可以查出来数据。
第二种:
如果这个字段你也想要查询那么就先创建一个临时表,然后把远程的含CLOB字段的表导入到临时表中,通过临时表来查询。
也可以把零时表的数据插入到原表中。
create table temp_test as select * from test@DB_LINK where id =: ID ;
insert into temp_test select * from test@DB_LINK where id = : ID;
insert into test select * from test_temp;
commit;
select * from test_temp;