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

Home -> Community -> Usenet -> c.d.o.tools -> Re: Updating one table from another

Re: Updating one table from another

From: Tina Mancuso <tina_mancuso_at_yahoo.com>
Date: 2000/05/08
Message-ID: <8f7c6m$5bv$1@nnrp1.deja.com>#1/1

In article <39172f30_at_news>,
  "Patrick Joyal" <please.reply_at_to.the.newsgroup> wrote:
> Try something like this
>
> Update sometable_a a set total_pts = total_pts +
> (Select points_earned from sometable_b b where id = a.id and
> b.date_input = getDate)

Won't that update ALL the rows in sometable_a? I tried something like that on a different set of tables a few days ago, and because there's no WHERE clause on the outer query (only on the subquery), there's no limit on which rows get updated. The subquery, run by itself, gives the result you'd expect, but when you put it in as part of the update, it doesn't work. Unless there's something I'm missing.

Anyway, it's a moot point -- I tried the above on my test tables, and got this error: "ORA-00936: missing expression" regarding the "select" subquery.

--Tina

--
tina_mancuso_at_yahoo.com, tina_at_monster-island.org


Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Mon May 08 2000 - 00:00:00 CDT

Original text of this message

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