Oracle通过DBLink操作数据表,报错“ORA-22992:无法使用从远程表选择的lob定位器”

来源:互联网 发布:socket服务器编程 编辑:程序博客网 时间:2024/05/21 22:43
---1、在本地创建包含blob的临时表
create global temporary table temp1 (a varchar2(20),x BLOB)
on commit delete rows 
---2、在本地创建目标临时表
CREATE TABLE TEMP2
AS
select * from temp1  where 1=2
---3、将远程表的数据插入到临时表中
INSERT INTO temp1
select smt_salaryno,smt_photo from ecard.photo@lk_ykt ---千万不要comit,不然temp1表的数据会变清空
--4、将临时表中的数据插入到目标临时表
INSERT INTO TEMP2
select * from temp1
--5、针对包含blob表去重的方法
insert into jw_jg_jzgzpb
select a,x from (
select  a,x,row_number() over(partition by a order by a) px from yhb a,TEMP2 b  where yhlx='teacher' and a.yhm=b.a
and a  in (
SELECT distinct a  FROM TEMP2 group by a having count(*)>1
) ) where px=1
阅读全文
0 0
原创粉丝点击