× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On Mon, Mar 2, 2009 at 9:27 AM, Jim Minisce <jminisce@xxxxxxxxx> wrote:


Hi all,

I am working on an SQL statement to update fields in a file. Here is
what I have so far:

update qtemp/fcmst# as Q
set (FCJAN,FCFEB,FCMAR,FCAPR,FCMAY,FCJUN,FCJUL) =
(Select FCJAN,FCFEB,FCMAR,FCAPR,FCMAY,FCJUN,FCJUL
From LIBNAME/FCMST# as A
Where Q.ITNBR = A.ITNBR and Q.CTYPE = A.CTYPE and
A.FISYY = 2008)
Where FISYY = 2028



Apply the coalesce function on each column that may be null:

update qtemp/fcmst# as Q
set (FCJAN,FCFEB,FCMAR,FCAPR,FCMAY,FCJUN,FCJUL) =
(Select coalesce( FCJAN , 0 )
, coalesce( FCFEB , 0 )
, coalesce( FCMAR , 0 )
, coalesce( FCAPR , 0 )
, coalesce( FCMAY , 0 )
, coalesce( FCJUN , 0 )
, coalesce( FCJUL , 0 ) )
From LIBNAME/FCMST# as A
Where Q.ITNBR = A.ITNBR and Q.CTYPE = A.CTYPE and
A.FISYY = 2008)
Where FISYY = 2028



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.