Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: UPDATE query problem

Re: UPDATE query problem

From: <sybrandb_at_hccnet.nl>
Date: Sat, 30 Jun 2007 17:04:09 +0200
Message-ID: <p0sc8397cpl4r0fipgrbk2ti20khb3j8jo@4ax.com>


On Sat, 30 Jun 2007 16:31:54 +0200, Urs Metzger <urs_at_ursmetzger.de> wrote:

>Sorry, Sybrand, your update performs fine, but with wrong results.
>It tries to find value pairs in xref where keyval1 = keyval2.
Yeah, this is why I labeled the design as bad. Apart from that it was relatively late, and I can't verify here, as I don't have Oracle on this system

In
>my test case it leaves mytable.description and mytable.helptext
>with all NULLs. And it does use two subqueries:
> ... = (select description,helptext ...
>and
> ... in (select xref.keyval2 ...
>
>But maybe my definition of "subquery" differs from your's.

My point was
set <column> = (select .. from ...),
set <column> = (select .. from ...)
was unnecessary
as SQL allows
(....,...) = (select ...,... from ....)

No multiple subqueries required, no need to resort to PL/SQL.

-- 
Sybrand Bakker
Senior Oracle DBA
Received on Sat Jun 30 2007 - 10:04:09 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US