ORA 22992 -- silly

I realize that you cannot access LOB locators from remote DBs, so don't think I am reporting this as a bug.
But, your developer explanations to customers are very poor (just cut/paste from documentation and/or error desc). We (most developers/customers) have looked at the forums, the documentation, and we need a work-around.
It is ridiculous to think that Oracle has used (C)LOBs to replace LONG datatypes, but you can't access these fields through a remote DB link.
To say this is a limitation is a major understatement... perhaps an unforseen design flaw with the LOB datatypes?
How are shops supposed to scale to multiple locations (servers) if Oracle won't allow certain fields to be accessed remotely.
Any response would be appreciated...
Thanks,
Adam

Click on the link below for a couple of workarounds by Tom Kyte:
http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:950029833940

Similar Messages

  • Creating view containing case statements received error ORA-22992

    We have a create view referencing table through dblink. The select statement in the create view has case statements, when running the Select statement alone, results are return. However, when executing the create view, it returns:
    SQL Error: ORA-22992: cannot use LOB locators selected from remote tables
    22992. 00000 - "cannot use LOB locators selected from remote tables"
    *Cause:    A remote LOB column cannot be referenced.
    *Action:   Remove references to LOBs in remote tables.
    One of the source table has LOB column but not in the select statement. The strange thing is when removing the case statement from the select, create view works fine. Can anybody tell me what caused the error and how to fix it?
    Create View Snippet:
    CREATE OR REPLACE VIEW "ABC"."XYZ" (....
    AS SELECT
    CASE
    WHEN A.OUTAGE =1
    THEN 'Y'
    ELSE 'N'
    END AS OUTAGE,
    FROM
    TABLEA@XXXX A
    LEFT JOIN TABLEB@XXXX B
    ON
    A.LOC =B.LO
    AND A.SITE =B.SITE
    WHERE
    A.CLASS ='CUSTOMER'
    AND A.PLUSSISGIS =1;

    What is your 4 digit Oracle version?
    Try rewriting the query to not use ANSI SQL92 joins. I found a link where this solved a problem similar to yours.
    DBLink problem ORA-22992
    >
    But, look at this curious thing: I re-write the query as follows:
    SELECT A.ID, A.ID_REF, A.EVENDATE, B.DESCRIPTION
    FROM A@ORCL A, B@ORCL B
    WHERE A.ID_REF = B.ID_REF;
    and it works fine... It seems like Oracle don't like the ANSI SQL92...
    >
    Several similar links by googling: 'SQL Error: ORA-22992'
    http://www.dbuggr.com/smallwei/solution-error-ora-22992-lob-locators-selected-remote-tabl/
    >
    Fixing ORA-22992 “cannot use LOB locators selected from remote tables” error
    You have migrated your Oracle 9i database to 10g and a distributed statement which worked fine in 9i now is getting error ORA-22992 “cannot use LOB locators selected from remote tables”. Even though the related remote table(s) does not contain any LOB column datatype.
    FIX:
    There is a bug on 9i,10g, and 11g that is related to this error. It is being fixed in 11.2. It can also be backported for previous 9i, 10g and 11g releases under the latest patchsets.
    You may also do a workaround as follow:
    Modify the affected SQL by adding the TO_CHAR function. For example:
    -- Original SQL:
    SELECT NVL2('a', 'b','c' ) FROM dual@remote_db;
    -- Modified SQL:
    SELECT TO_CHAR(NVL2('a','b','c')) FROM dual@remote_db;
    >
    See if that helps.

  • Materialized view fast refresh ...getting ORA-22992: error

    Hi All,
    Oracle version 11.1.0.7
    While creating a materialized view(Fast refresh) on remote tables ... i am getting the ORA-22992: cannot use LOB locators selected from remote tables ... error.
    but the actual scenario is... i am not selecting any of the BLOB/LOB columns from the remote tables. I did n't include them in my materialized query.
    I am able to refresh it complete but couldn't refresh it fast. Here i want to mention other thing... when ever i have records in Mat view log(Base table has a blob cloumns in it)
    i am getting the above error. when no record in the Mat view log(i.e on BLOB base table) .. i can able to refresh it as FAST.
    MV_CAPABILITIES table tells that ...My Mat view is able to refresh it FAST.I don't know howw to approach to solve this issue.could some one tell me the approach..to solve it?
    Here is the sample code ....this is what i have done so fat
    session 1 (REMOTE_ONE)
    I have created synonyms for the remote tables on current schema. That's why i didn't include @DBLINK.
    create table RT_A ( col1_A varchar2(20), col2_A BLOB,COL3_A NUMBER);
    create a table RT_B (COl1_B varchar2(20), col2_B BLOB, COL3_B NUMBER);
    create a table RT_C (COL1_C varchar2(20), col2_C VARCHAR2,COL3_C NUMBER);
    create  MATERIALIZED VIEW LOG ON RT_A 
    WITH  ROWID EXCLUDING NEW VALUES;
    create  MATERIALIZED VIEW LOG ON RT_B
    WITH  ROWID EXCLUDING NEW VALUES;
    create  MATERIALIZED VIEW LOG ON RT_C 
    WITH  ROWID EXCLUDING NEW VALUES;
    grant select on RT_A to CUURRENT_ONE with grant option;
    grant select on RT_B to CUURRENT_ONE with grant option;
    grant select on RT_C to CUURRENT_ONE with grant option;
    grant select on MLOG$_RT_A to CUURRENT_ONE with grant option;
    grant select on MLOG$_RT_B to CUURRENT_ONE with grant option;
    grant select on MLOG$_RT_C to CUURRENT_ONE with grant option;Session 2 (CUURRENT_ONE)
    create materialized view ABC_MV
    BUILD IMMEDIATE REFRESH FORCE ON DEMAND START WITH SYSDATE NEXT SYSDATE+1
    AS
    select A.ROWID AS A_ROWID,
    B.ROWID as B_ROWID,
    C.ROWID AS C_ROWID,
    A.COL1_A,
    B.col1_B,
    c.col1_c
    from RT_A, RT_B,RT_C
    where COL3_A = COL3_B(+)
    and COL3_B = COL3_C(+)Appreciate your help.
    Thanks,
    Mike

    Thanks for the reply
    In that he/she is selecting the LOB column from the remote database(master site).
    I am just referencing the table which has BLOB column in it.I am not referencing any LOB column in my select(Mat view) query...
    is there anything i need to check..?
    Regards,
    Mike

  • PL/SQL: ORA-22992: cannot use LOB locators selected from remote tables

    Dear ALL,
    My O/S is Redhatlinux 5.2 and i had Migrated my Oracle databse to 11g2. But after that while i am retrieving records through dblinks from one of my other Oracle 9.2.0.8 databse it's throwing the error : PL/SQL: ORA-22992: cannot use LOB locators selected from remote tables.* This error i am getting in TOAD as well as SQL Developer.
    Can anybody tell me how to fix this error ? Because am not able to get the records.
    Also am getting another error during retrieving data from some of my tables after migrating i.e the table which having CLOB data type while am accessing to retrieve the records using select query it's throwing the error :
    +(The following error has occurred:+
    A query with LOB's requires OCI8 mode, but OCI7 mode is used.)
    If anyone having any idea kindly share.
    Thanks and Regards
    Biswa

    Hi,
    Ya what u sent that is fine. But already am using one procudure which is accessing LOB data from another databse through DBlink and working fine. But there Both the databse are 9.2.0.8.
    But while am executing the same procedure in oracle 11g where the Dblink accessing the data from Oracle 9i , there am getting this error.
    Kindly tell if u know any resolution.
    Thanks

  • Ora 22992 -------- CLOB issue

    Hi ,
    I have a database in
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    I have table tableAAA in database1,which has a clob column.
    I want to select the CLOB column to Another database (database2)
    So I create a view
    (create or replace view my_view_tableAAA as select * from tableAAA)
    view created
    select * from schema.my_view_tableAAA@mydblink
    (ORA-22992: cannot use LOB locators selected from remote tables)
    What mistake am i doing ?
    Rgds
    S

    DBLink problem ORA-22992
    Try the above, Google is really useful sometimes.

  • Error ORA-22992, what to do?

    I created database link to another oracle db (same version: 9.2). Now I want to create view for a table with BLOB.
    "create or replace view persons as select * from persons@serv2"
    What can I do?

    http://asktom.oracle.com/pls/ask/f?p=4950:8:9407757796067305436::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:5322964030684
    ORA-22992 cannot use LOB locators selected from remote tables
    Cause: A remote LOB column cannot be referenced.
    Action: Remove references to LOBs in remote tables.

  • ORA-22992: cannot use LOB locators selected from remote tables

    Has anyone had this error msg before?
    Thx .

    If you want, you could facilitate your process with a global temporary table as follows:
    SQL> create global temporary table clob_temp (
      2  id         number,
      3  test_clob  clob)
      4  on commit delete rows;
    Table created.
    SQL> Create or Replace procedure run_clob (p_id in number, p_file_name in varchar2)
      2    AS
      3       l_clob          clob;
      4       l_bfile         bfile := BFILENAME ('TEMP_DIR', p_file_name);
      5  begin
      6      insert into clob_temp values (p_id, empty_clob() )
      7               returning test_clob into l_clob;
      8      DBMS_LOB.OPEN(l_bfile, DBMS_LOB.LOB_READONLY);
      9      DBMS_LOB.LOADFROMFILE(l_clob, l_bfile, DBMS_LOB.getlength(l_bfile));
    10      DBMS_LOB.CLOSE(l_bfile);
    11      insert into clob_table@dlog_link (id, test_clob)
    12               select * from clob_temp;
    13      commit;
    14  end;
    15  /
    Procedure created.
    SQL> select count(*) from clob_table@dlog_link;
      COUNT(*)
             0
    SQL> exec run_clob (1, 'clobtest.txt')
    PL/SQL procedure successfully completed.
    SQL> select count(*) from clob_table@dlog_link;
      COUNT(*)
             1

  • Help in ORA-22992 erroe

    hi .
    i have two schama d1 and d2 i create database link between them to create some tables that contain some information about the data in the d1 tables sum,count .....
    in d1 there is table that contain blob column i know that this column of blob type couse the error but i do not select it in the query :
    select count(recm.RECOMMENDATIONID) count, sum(rp.COST) cost ,dg.DIA DIA ,
    to_char(de.F_DATE,'mm-yyyy') F_Date
    from decc@EMOH40LNK de inner join requests@EMOH40LNK rq on(rq.REQUESTID = de.REQUESTID)
    inner join recomm@EMOH40LNK recm on(recm.RECOMMENDATIONID = de.RECOMMENDATIONID)
    inner join RECOMMPro@EMOH40LNK rp on(recm.RECOMMENDATIONID = rp.RECOMMENDATIONID)
    inner join DIA@EMOH40LNK dg on(dg.CODE = rq.REQUESTCODE)
    where
    de.F_DATE>=to_date('','');
    so how can do it ........
    thak you all.....

    Implement the query as a view in database EMOH40LNK, like this:
    CREATE OR REPLACE VIEW REMOTE_VIEW AS
    select count(recm.RECOMMENDATIONID) count, sum(rp.COST) cost ,dg.DIA DIA ,
    to_char(de.F_DATE,'mm-yyyy') F_Date
    from decc de inner join requests rq on(rq.REQUESTID = de.REQUESTID)
    inner join recomm recm on(recm.RECOMMENDATIONID = de.RECOMMENDATIONID)
    inner join RECOMMPro rp on(recm.RECOMMENDATIONID = rp.RECOMMENDATIONID)
    inner join DIA dg on(dg.CODE = rq.REQUESTCODE)
    where
    de.F_DATE>=to_date('','');(sorry, I was sloppy in my original - removed @EMOH40LNK references from query)
    Then, in your local database,
    SELECT * FROM REMOTE_VIEW@EMOH40LNK ;This should force the query to be resolved in the remote database, so that the LOBs will not be involved in the query over the link.
    Edited by: mtefft on Jul 6, 2010 4:47 AM

  • Error In Distributed Query moving LOB

    The following error has occurred:
    ORA-22992: cannot use LOB locators selected from remote tables
    ORA-02063: preceding line from BMB5_ADM
    ORA-02063: preceding 2 lines from BMB18CU3
    Query:
    INSERT INTO IMAGE@BB18C3
    SELECT B.*
    FROM IMAGE@BB17CS B,INV@BB17CS I
    WHERE B.ref_no = I.ref_no AND B.ref_resets = I.ref_resets AND I.a_no = 70
    Is there a way around moving a LOB from one database to the next. I can not use Import/Export it has to be done as part of a query.
    Thanks,
    Gavin

    Gavin,
    Had same problem... see thread entitled "ORA 22992 -- silly" in the PL/SQL and SQL forum.
    Barbara lists a link that spells out two workarounds (only one that would work for BLOBs though).
    Thanks,
    Adam

  • ORA-12541: TNS: no listener when attempting to log int SQL*Plus

    Hi everyone,
    Since we are now studying forms. I installed The Developer Suite on the same machine as the Oracle Database. I was able to use SQL*Plus and the Procedure Builder in Oracle Forms. I was able to connect to the Oracle 8i database with the Oracle 9i Developer. Then I started playing with forms and when I tried to run the form it told me that it could not find a listener. So, I made some changes on the Oracle Database and added a listener and gave it the 8888 port that it was looking for. That did not work so I change the properties on the forms to the port that the database listener had 1521 or at least that is what I believe it was. Now I cannot connect to Oracle SQL*PLus and I cannot connect from the forms to the database either. I have deleted the listeners and added them again. I have checked under services to make sure that it is started. Has anyone seen this before.
    Thanks for any help.
    Robert

    The problem comes into play when you try to select the actual LOB locator remotely, however straight INSERTs aren't a problem.
    SQL> desc test_clob1
    Name                                      Null?    Type
    A1                                                 NUMBER
    A2                                                 CLOB
    SQL> desc test_clob2@remotedb
    Name                                      Null?    Type
    A1                                                 NUMBER
    A2                                                 CLOB
    SQL> declare
      2     big_text varchar2(32767) := rpad('#',32767,'#');
      3  begin
      4       insert into test_clob1 values (1, big_text );
      5  end;
      6  /
    PL/SQL procedure successfully completed.
    SQL> select a1, dbms_lob.getlength(a2) from test_clob1;
            A1 DBMS_LOB.GETLENGTH(A2)
             1                  32767
    SQL> select count(*) from test_clob2@remotedb;
      COUNT(*)
             0
    SQL> insert into test_clob2@remotedb
      2  select * from test_clob1;
    1 row created.
    SQL> select a1, dbms_lob.getlength(a2) from test_clob2@remotedb;
    select a1, dbms_lob.getlength(a2) from test_clob2@remotedb
    ERROR at line 1:
    ORA-22992: cannot use LOB locators selected from remote tables
    SQL> commit;
    Commit complete.However, if I do a COMMIT and then go to the remote database and do the same query, I get the following:
    SQL> select a1, dbms_lob.getlength(a2) from test_clob2;
            A1 DBMS_LOB.GETLENGTH(A2)
             1                  32767HTH

  • ORA-12541: TNS:no listener - when executing procedure

    Hi,
    I am getting the following error when execting a procedure within a package:
    =======================================================
    SQL> execute VRT_PIVOTAL_TEMP_INT.GET_NEW_PIVOTAL_ANON_TRANS
    BEGIN VRT_PIVOTAL_TEMP_INT.GET_NEW_PIVOTAL_ANON_TRANS; END;
    ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error
    ORA-06512: at "SYS.DBMS_LOB", line 722
    ORA-06512: at "MPD.VRT_PIVOTAL_TEMP_INT", line 2579
    ORA-06512: at "MPD.VRT_PIVOTAL_TEMP_INT", line 2430
    ORA-12541: TNS:no listener
    ORA-06512: at line 1
    =======================================================
    But the listener is up and I can ping the host as well as tnsping the connect string. I am trying to execute it on the server itself.
    Please help.
    Prachi

    The problem comes into play when you try to select the actual LOB locator remotely, however straight INSERTs aren't a problem.
    SQL> desc test_clob1
    Name                                      Null?    Type
    A1                                                 NUMBER
    A2                                                 CLOB
    SQL> desc test_clob2@remotedb
    Name                                      Null?    Type
    A1                                                 NUMBER
    A2                                                 CLOB
    SQL> declare
      2     big_text varchar2(32767) := rpad('#',32767,'#');
      3  begin
      4       insert into test_clob1 values (1, big_text );
      5  end;
      6  /
    PL/SQL procedure successfully completed.
    SQL> select a1, dbms_lob.getlength(a2) from test_clob1;
            A1 DBMS_LOB.GETLENGTH(A2)
             1                  32767
    SQL> select count(*) from test_clob2@remotedb;
      COUNT(*)
             0
    SQL> insert into test_clob2@remotedb
      2  select * from test_clob1;
    1 row created.
    SQL> select a1, dbms_lob.getlength(a2) from test_clob2@remotedb;
    select a1, dbms_lob.getlength(a2) from test_clob2@remotedb
    ERROR at line 1:
    ORA-22992: cannot use LOB locators selected from remote tables
    SQL> commit;
    Commit complete.However, if I do a COMMIT and then go to the remote database and do the same query, I get the following:
    SQL> select a1, dbms_lob.getlength(a2) from test_clob2;
            A1 DBMS_LOB.GETLENGTH(A2)
             1                  32767HTH

  • Error while accessing a Table on Oracle Database 10.2

    Hi Experts,
    We have a table that contains a CLOB datatype in one of its column. However when i tried to access the table i get the below error.
    <b>Table Name:</b> discrete_jobs
    <b>Error:</b>
    (Error starting at line 1 in command:
    select * from [email protected]
    Error report:
    SQL Error: ORA-22992: cannot use LOB locators selected from remote tables
    22992. 00000 - "cannot use LOB locators selected from remote tables"
    *Cause:    A remote LOB column cannot be referenced.
    *Action:   Remove references to LOBs in remote tables.)
    Pleas Help!
    Regards,
    Ravi R

    See some work arounds - "How to select table from remote database having clob field</a>

  • Replicating clobs and blobs in a remote database across dblink

    9iR2
    When creating a materialized view in a warehouse pointing to a remote table in an OLTP environment, I got this error when trying to replicate a table with 3 clobs.
    ORA-22992: cannot use LOB locators selected from remote tables
    So, how does Oracle recommend replicating Blobs and Clobs in a remote database/warehouse? Evidently using materialized views doesnt work.

    MV replication is obsolete.
    Move to 10gR2 and use Streams.

  • Insert a blob in remote database using dblink

    i have a view (it has a BLOB column) from where i need to select the records. After selecting i need to insert it into a synonym in the remote database through a db link.
    if i execute the procedure i get error; ora-22992--cannot use LOB locators selected from remote table. My code is
    INSERT INTO [email protected]
    SELECT PID,RNO, PTYPE,blob_field
    FROM view;
    I dont wish to creat a temporary table and still wish to perform the above function.
    So is there any method to do this. I tried with DBMS_LOB.APPEND but it didnt work out. Any solution will be greatly appreciated.
    Thanks,
    -Nitin

    i have a view (it has a BLOB column) from where i need to select the records. After selecting i need to insert it into a synonym in the remote database through a db link.
    if i execute the procedure i get error; ora-22992--cannot use LOB locators selected from remote table. My code is
    INSERT INTO [email protected]
    SELECT PID,RNO, PTYPE,blob_field
    FROM view;
    I dont wish to creat a temporary table and still wish to perform the above function.
    So is there any method to do this. I tried with DBMS_LOB.APPEND but it didnt work out. Any solution will be greatly appreciated.
    Thanks,
    -Nitin

  • Regarding CLOB datatype

    Hi,
    I have two databases with sids' R2SRVR5.WORLD and R2SRVR3.WORLD
    Now I have executed the follwoing in r2srvr5 database.
    create table kou_test_1
    roll integer,
    clob_data clob
    begin
    insert into kou_test_1(roll,clob_data) values (2,empty_clob());
    insert into kou_test_1(roll,clob_data) values (3,empty_clob());
    commit;
    end;
    declare
    v_clob clob := 'dfhgfjudhgjfhjdhgdhjghdjrjgjgjhfhjjgfyugfygfjgfjgfjgjygjyfgwfg
    gfjygfjygfjuyuiryugyubgryuwbgrjyubgrjgrjywgerjgrgw
    eukwgfuweyjyegfjgfjhrjujuhwruihri';
    begin
    update kou_test_1 set clob_data=v_clob where roll=3;
    commit;
    end;
    Now I have created a table in r2srvr3 database.
    create table kou_test_2
    roll integer,
    clob_data clob
    and also created a database link from r2srvr3 to r2srvr5.
    now when I am executing the following code it gives the error "ORA-22992: cannot use LOB locators selected from remote tables
    ORA-06512: at line 2"
    begin
    insert into kou_test_2(roll,clob_data)
    select roll,decode(roll,3,clob_data,empty_clob())
    from [email protected];
    commit;
    end;
    Now can any body provide me any solution of it except two separate inserts like
    begin
    insert into kou_test_2(roll,clob_data)
    select roll,clob_data
    from [email protected]
    where roll=3;
    commit;
    end;
    insert into kou_test_2(roll,clob_data)
    select roll,null
    from [email protected]
    where roll<>3;
    commit;
    end;
    Waiting for reply,
    Regards,
    Koushik

    Hi,
    I have two databases with sids' R2SRVR5.WORLD and R2SRVR3.WORLD
    Now I have executed the follwoing in r2srvr5 database.
    create table kou_test_1
    roll integer,
    clob_data clob
    begin
    insert into kou_test_1(roll,clob_data) values (2,empty_clob());
    insert into kou_test_1(roll,clob_data) values (3,empty_clob());
    commit;
    end;
    declare
    v_clob clob := 'dfhgfjudhgjfhjdhgdhjghdjrjgjgjhfhjjgfyugfygfjgfjgfjgjygjyfgwfg
    gfjygfjygfjuyuiryugyubgryuwbgrjyubgrjgrjywgerjgrgw
    eukwgfuweyjyegfjgfjhrjujuhwruihri';
    begin
    update kou_test_1 set clob_data=v_clob where roll=3;
    commit;
    end;
    Now I have created a table in r2srvr3 database.
    create table kou_test_2
    roll integer,
    clob_data clob
    and also created a database link from r2srvr3 to r2srvr5.
    now when I am executing the following code it gives the error "ORA-22992: cannot use LOB locators selected from remote tables
    ORA-06512: at line 2"
    begin
    insert into kou_test_2(roll,clob_data)
    select roll,decode(roll,3,clob_data,empty_clob())
    from [email protected];
    commit;
    end;
    Now can any body provide me any solution of it except two separate inserts like
    begin
    insert into kou_test_2(roll,clob_data)
    select roll,clob_data
    from [email protected]
    where roll=3;
    commit;
    end;
    insert into kou_test_2(roll,clob_data)
    select roll,null
    from [email protected]
    where roll<>3;
    commit;
    end;
    Waiting for reply,
    Regards,
    Koushik

Maybe you are looking for