dbTalk Databases Forums  

Replacing multiple statements with a MERGE

comp.databases.ibm-db2 comp.databases.ibm-db2


Discuss Replacing multiple statements with a MERGE in the comp.databases.ibm-db2 forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
Tonkuma
 
Posts: n/a

Default Re: Replacing multiple statements with a MERGE - 06-30-2010 , 05:31 PM






I want to add a note.

Quote:
WHEN NOT MATCHED
AND EXISTS
(SELECT 0
FROM Auctions e
WHERE e.item_id = b.item_id
) THEN
INSERT

I also tried:
WHERE m.item_id = a.item_id

It returned error:
SQL0206N "A.ITEM_ID" is not valid in the context where it is used.

So, I thought that the target table can't be referred in WHEN NOT
MATCHED clause.
And it would be rational.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.