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: FYI - New syntax allows you to update one table while joining to others

Re: FYI - New syntax allows you to update one table while joining to others

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Thu, 19 Oct 2000 23:11:24 +0200
Message-ID: <972017031.18795.3.pluto.d4ee154e@news.demon.nl>

Which is of course in the Sql reference manual, but usually no one reads that.

Regards,

Sybrand Bakker, Oracle DBA

<sbrendan_at_my-deja.com> wrote in message news:8sn244$2rj$1_at_nnrp1.deja.com...
> This syntax allows you to update one table while joining to many others
> - I find this simplier that doing sub-queries. This is similar to how
> other db servers work. Hope you find this interesting!
>
> Here is an example:
> update
> (
> select
> a.TOTAL_POSITION_VALUE_AMT,
> a.TOTAL_SHARE_QTY,
> b.FIN_INSTRUMENT_PRC
> from A_FPBAL_AUG_SEP_OCT_NOV a,
> MSC_FIN_INSTRUMENT_PRICES b
> where a.MONTH_TIME_ID = b.MONTH_TIME_ID
> and a.FIN_INSTRUMENT_ID = b.FIN_INSTRUMENT_ID
> and b.MONTH_TIME_ID = 36799
> )
> set a.TOTAL_POSITION_VALUE_AMT = a.TOTAL_SHARE_QTY *
> b.FIN_INSTRUMENT_PRC
> ;
> -- ===============================================
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Thu Oct 19 2000 - 16:11:24 CDT

Original text of this message

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