Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Help needed for the 'subquery returns multiple rows' problem
Good day to the members of this newsgroup,
For six months i have been working with Oracle7 and with some programs of the Developer 200 pack. And by working with it i learned more about PL/SQL and how to use it.
Unfortunately, I'm still having problems with updating a column based on values from another table. Up till now i more or less bypassed the problem by making two cursors and updating one cursor with the values contained in the other table.
This brings me to the following question: Is it possible to use a subquery in an update statement with contains different values (as the values i need are not the same for the entire column).
Example: update COMPANY
set company_name = (select a.comp_name from temp a, temp2 b where a.id = b.id);
Gevolg: ORA- ..... : subquery returns multiple rows
If it can't be done then my last question is:
is it possible to fetch the first row AGAIN from a current cursor
(as i need the same values to check another table and closing and opening
the same cursor seems a
big waste of time)
All tips, trics or tactics will be highly appreciated,
Peter Lowagie Received on Mon Jul 28 1997 - 00:00:00 CDT