您的位置:首页 > 数据库 > Oracle

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

2017-10-29 21:45 423 查看
---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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: