Re: Multi column update based on another table

From: William Robertson <williamr2019_at_googlemail.com>
Date: Tue, 15 Jan 2008 00:14:27 -0800 (PST)
Message-ID: <cb673ddf-526a-4f7a-bd4c-95b3d54dbc01@y5g2000hsf.googlegroups.com>


On Jan 15, 12:53 am, Sashi <small..._at_gmail.com> wrote:
> Hi Folks,
> I'm writing a simple update statement in Ora 9.2 and am scratching my
> head as to why the following syntax is wrong:
> ------------------------------------------------------------------------------------------------------------
> update CITI_CIRCUIT_LBCODE A
> Set (LOOPBACK_ADDR_A, HOST_NAME_A ) = (SELECT
> LOOPBACK_ADDR,
> HOST_NAME
> FROM
> CITI_DEVICE B
> WHERE A.DEVICE_NAME_A =
> B.DEVICE_ID);
> ------------------------------------------------------------------------------------------------------------
>
> >[Error] Script lines: 1-7 --------------------------
>
> ORA-01427: single-row subquery returns more than one row
>
> Can someone please help out?
> Thanks in advance,
> Sashi

The syntax is fine. It looks like DEVICE_ID is not unique in CITI_DEVICE though. Received on Tue Jan 15 2008 - 02:14:27 CST

Original text of this message