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

Home -> Community -> Usenet -> c.d.o.misc -> Re: PL/SQL : Probleme with not existence of result in temporary table

Re: PL/SQL : Probleme with not existence of result in temporary table

From: DA Morgan <damorgan_at_exesolutions.com>
Date: Fri, 07 Mar 2003 15:53:17 -0800
Message-ID: <3E6930ED.5090B752@exesolutions.com>


Philippe Gobin wrote:

> PL/SQL : Probleme with not existence of result in temporary table
>
> Hi, i have a problem with this request :
>
> update
> TABLE_U
> set field_u = (
> select PV.res
> from
> TABLE_1
> ,
> (
> SELECT
> CI4.cd_mkp,
> SUM(CI4.mt_pvp) res
> FROM
> INTRA_IFT_CAT CI4
> WHERE
> CI4.ind_netting = 0
> GROUP BY
> CI4.cd_mkp,
> ) TABLE_2
>
> where
> TABLE_1.val = TABLE_U.val
> AND TABLE_2.cd_mkp = TABLE_U.cd_mkp
> )
> where
> TABLE_1.val = TABLE_U.val
> AND TABLE_2.cd_mkp = TABLE_U.cd_mkp
> ;
>
> With this, i want this result :
>
> When 'res' exists, the field must be update whith PV.res.
> When 'res' doesn't exist (the request that generate TABLE_2 give no
> line), the field 'fild_u' must not be changed.
>
> In fact the resut is :
> When 'res' exists, the field must be update whith PV.res.
> When 'res' doesn't exist, the field 'fild_u' IS UPDATED BY NULL.
>
> Is anybody can help me ?
>
> Thanks
> PG

This is not suitable for a single select statement.

Daniel Morgan Received on Fri Mar 07 2003 - 17:53:17 CST

Original text of this message

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