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: UPDATE... SET... FROM x

Re: UPDATE... SET... FROM x

From: gilb <gilbertcj_at_gmail.com>
Date: 22 Nov 2005 08:20:52 -0800
Message-ID: <1132676452.738739.319940@z14g2000cwz.googlegroups.com>


Well thank you for the useful feedback.

In case anyone here listens to your trolling, unconstructive comments
(I've checked your history, others who haven't should), the code I
quoted above is mine which I have previously written in t-sql and want to replicate in Oracle.

I have solved the problem now but perhaps in future you could give me some keywords like nvl() to search for. However I am assuming that you did know the answer to my question - which you probably didn't.

For the benefit of others the code I have used is as follows:

update twr3_01.orapropertymonthlyderived opmd set (opmd.m32) =
nvl(opmd.m32,
(

  select m32
  from twr3_01.orapropertymonthlyderived

  where opmd.ipdref =	ipdref AND
  opmd.periodendmonth =	periodendmonth AND
  opmd.periodendyear = periodendyear AND
  opmd.snapshotref = snapshotref AND
  opmd.datastatetypecode = datastatetypecode AND
  opmd.sampleref = sampleref AND
  opmd.periodendfrequency 	=	periodendfrequency AND
  m70 = 1
)); Received on Tue Nov 22 2005 - 10:20:52 CST

Original text of this message

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