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 with DECODE in subquery

Re: UPDATE with DECODE in subquery

From: Wolf 'n Pinguin <duif.op.spijkers_at_wxs.nl>
Date: 14 Aug 1999 23:27:52 GMT
Message-ID: <01bee6a7$b4fa9300$dee179c3@nentjesi>

vick9935_at_my-deja.com schreef in artikel <7oupi4$8uk$1_at_nnrp1.deja.com>...

<SNIP>

> Here is the UPDATE statement with subquery:
>
> UPDATE CP_PROJECT a
> SET PROJ_DESC =
> (SELECT
> DECODE(a.PROJ_DESC,NULL,DECODE(b.PROJ_DESC,NULL,c.SITE_NAME,b.PROJ_DESC)
> ,a.PROJ_DESC)
> FROM CP_SITE c,CP_ORACLE_PROJECT b
> WHERE a.PROJ_NO = c.PROJ_NO(+)
> AND a.PROJ_NO = b.PROJ_NO(+)
> AND c.SITE_STATUS(+) = 'P'
> )
> ;

Hi,

I don't see anything wromng at face value, but why don't you simply add "WHERE PROJ_DESC is not NULL" to the update (i.e. autside the subquery) ? The known project names will be left alone.

Good Luck, Ide Received on Sat Aug 14 1999 - 18:27:52 CDT

Original text of this message

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