Re: multiple values updates

From: Stephen Lappin <SL_at_rtel.demon.co.uk>
Date: Thu, 16 Jun 1994 17:21:22 +0000
Message-ID: <771787282snz_at_rtel.demon.co.uk>


In article <29172_at_dciem.dciem.dnd.ca> selina_at_dciem.dnd.ca "Selina Glynn" writes:

> I need to update a field from the values of another table. I have written
> a similar update statement before, it used to work now its complains:
>
> SQL> update divername
> 2 set file_no =
> 3 (select b.fn
> 4 from divername a, pers_info b
> 5 where a.last_name = b.lastn
> 6 and a.first_name = b.firstn)
> 7 /
> (select b.fn
> *
> ERROR at line 3:
> ORA-01427: single-row subquery returns more than one row
>

 SQL> update divername a
   2 set file_no =
   3 (select b.fn
   4 from pers_info b
   5 where a.last_name = b.lastn
   6 and a.first_name = b.firstn)
   7 /

-- 
Stephen Lappin

+-----------------+
| +-------------+ |  Real Time Engineering Ltd.
| |  Real Time  | |  Capital House
| +-------------+ |  20 Park Circus
| Engineering Ltd |  Glasgow G3 6BE         Tel: +44 (0)41 332 9400
+-----------------+  Scotland U.K.          Fax: +44 (0)41 331 2509
Received on Thu Jun 16 1994 - 19:21:22 CEST

Original text of this message