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

Last updated on JUNE 07, 2017

Applies to:

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

Goal

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);

Solution

Sign In with your My Oracle Support account

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

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms