Search notes:

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

select dbms_lob.substr(col_clob, 32000, 1) from xyz@dblink;
-- ORA-22992: cannot use LOB locators selected from remote tables

-- Make sure dbms_lob.substr is executed remotely
-- by suffixing it with @dblink:
select dbms_lob.substr@dblink(col_clob, 32000, 1) from xyz@dblink;
…

ORA-22992, Database links, CTAS and ROW_NUMBER() analytic function

For a reason I don't understand, the following scenario threw an ORA-22992 error (Oracle 19.03 and 19.16).
On the remote database, two tables are created:
create table tq84_A (
   id  number  ( 5) not null,
   txt varchar2(10)
);

create table tq84_B (
   id  number  ( 5) not null,
   clb clob
);
Then, on the local database, I try to create table like so (19.3 and 19.16):
create table tq84_C as
select
   row_number() over (order by 1) r
from
   tq84_A@dblink a                 join
   tq84_B@dblink b on a.id = b.id
;
This throws a ORA-22992 although the clob of tq84_B is not involved.
The table can be created if I don't use the analytic function:
create table tq84_C as
select
   1 r
from
   tq84_A@dblink a                 join
   tq84_B@dblink b on a.id = b.id
;
When I drop the clb column on the remote database, I can also create the table with the row_number() function:
alter table tq84_B drop column clb;

create table …

See also

Database links
Other Oracle error messages

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1758200330, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/databases/Oracle/errors/ORA-22992_cannot-use-LOB-locators-selected-from-remote-tables(90): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78