Re: How to update column in another database

From: Chuck Hamilton <chuckh_at_dvol.com>
Date: 1996/12/05
Message-ID: <32a9d6d9.2778490_at_n5.gbso.net>#1/1


usul_at_auctr.auc.edu (Ron McBay) wrote:

>I want to update the values in a column in a table in another database based
>on the values in a column in a table in a local database. Is this possible?
>I wanted to use a command like:
>
>UPDATE table1_at_db1 a, table2 b
> SET a.column1 = b.column2
> WHERE a.col_id = b.col_id
>
>That didn't seem to work and I don't know whether I'm just using the wrong
>syntax or whether what I want to do just isn't possible.
>
>Please advise.

Try this... (warning. untested code ahead.)

UPDATE table1_at_db1 a
  SET a.column1 =
    (SELECT column2 FROM table2 b
    WHERE b.col_id = a.col_id)
/

--
Chuck Hamilton
chuckh_at_dvol.com

This message delivered by electronic sled dogs. WOOF!
Received on Thu Dec 05 1996 - 00:00:00 CET

Original text of this message