My Oracle Support Banner

RDBPROD: How to Update a Table with Data from a Different Database (Doc ID 741592.1)

Last updated on OCTOBER 11, 2019

Applies to:

Oracle Rdb Server on OpenVMS - Version 7.1 and later
HP OpenVMS Itanium
HP OpenVMS Alpha


Trying to update a table with data from a different database reports the error:

%SQL-F-ONLONEDB, Only one database can be referred to in this statement

For instance, you are trying something similar to:

$ sql 
attach 'alias db1 filename work_db';
attach 'alias db2 filename warehouse_db'; 
update db2.employees E2
set E2.phone_number = (select E1.phone_number 
                       from db1.employees E1 
                       where E1.employee_id = E2.employee_id);


To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.