Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: UPDATE with DECODE in subquery
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