× 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.



From: Jon Paris

>> Yeah, it's called RPG <grin>.

I'm still not seeing how your or Birgitta's solution identifies _which_
columns in A are empty (i.e. they are blanks or nulls) and only update
them from B when they are currently empty. But I'll try to get my head
around it this morning.

It doesn't! That's not what you asked for. You asked to update ALL data
columns in A if a record is in B.

To update a field only if its NULL, you have a way:

SET A.FIELD = COALESCE(A.FIELD, B.FIELD)

This will check A.FIELD for NULL and use B.FIELD instead. Pretty
straightforward. It's less easy with arbitrary values such as blanks.
You'll need something like this:

SET A.FIELD = (CASE A.FIELD WHEN ' ' THEN B.FIELD ELSE A.FIELD END)

You'll have to have one of these for each column. This is where SQL
statements start to get big.

Joe



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.