Search code examples
sqloracleblobdblinklob

ORA-22992: cannot use LOB locators selected from remote tables even without using BLOB column


I have table which has one BLOB datatype column and i am using this table via dblink to insert into my schema table. But i dont use this BLOB datatype column in my insert query at all still i am getting error :
ORA-22992: cannot use LOB locators selected from remote tables

Below is my insert query:

insert /*+ materialize */ into  TOP.BKR 
( 
    SECTANRFFT,
    REFBEREICH  
) 
select
    SECTANRFFT,
    REFBEREICH  
FROM (  
select  
    txtr.SECTANRFFT SECTANRFFT,
    txtr.REFBEREICH REFBEREICH  
from    TOP.TB_ODS_LAST_DATE TB_ODS_LAST_DATE  INNER JOIN  BKP.ZORP@"TECD.POR" txtr  
    ON  1=1
where       (1=1)   
 and (TB_ODS_LAST_DATE.TABLE_NAME = 'SRTPO') and (to_date('19700101','yyyymmdd') + (((txtr.DAT/60)/60)/24) > TB_ODS_LAST_DATE.LAST_DATE)
)  FRT
  

Solution

  • You can add a driving_site hint:

    insert ...
    select /*+ driving_site(TB_ODS_LAST_DATE) */
    ...
    

    That will ask Oracle to send the local data to the remote site to do the join, rather than pulling the remote data (which may include the BLOB, at least nominally) to your local site.

    The hint is described in the documentation.