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



Hello Vern

update fileA
set fileA.field1 = fileB.field1
from fileA inner join fileB on fileB.key = fileA.key

is equivalent to

update fileA
set fileA.field1 = (select field1 from fileB where key = fileA.key )
where exists (select 0 from fileB where key = fileA.key)

it's the "where exists" clause that is all important

also, consider this:

update fileA
set fileA.field1 = fileB.field1,
fileA.field2 = fileC.field2,
fileA.field3 = fileD.field3
from fileA inner join fileB on fileB.key = fileA.key
inner join fileC on fileC.key = fileA.key
inner join fileD on fileD.key = fileA.key

achieving this with our DB2 method is exponentially more complex

Gad



date: Tue, 27 Oct 2020 11:20:53 -0500
from: Vernon Hamberg <vhamberg@xxxxxxxxxxxxxxx>
subject: Re: RFE for SQL update from

Can't we do something like this already?

update fileA

set fileA.field1 = (select field1

from fileB wherekey = fileA.key)

I could be wrong, but I feel like I've done this. Please correct me it
it's not doable.

And how is the RFE request different from that?

Cheers
Vern

On 10/27/2020 8:54 AM, Gad Miron wrote:
All folks


I've registered an RFE for SQL Update with a From clause.



http://www.ibm.com/developerworks/rfe/execute?use_case=viewRfe&CR_ID=1463


update fileA

set fileA.field1 = fileB.field1

from fileA inner join fileB on fileB.key = fileA.key



May I have your votes please.


Thanks

Gad





As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.