If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > upsert sql db2

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-26-09, 21:39
Somasundaram1 Somasundaram1 is offline
Registered User
 
Join Date: Oct 2009
Posts: 24
upsert sql db2

i know other database have upsert. but not db2. why not db2?
Reply With Quote
  #2 (permalink)  
Old 10-26-09, 22:05
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
In DB2 it is called MERGE. Basically the same thing.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #3 (permalink)  
Old 10-27-09, 00:03
Somasundaram1 Somasundaram1 is offline
Registered User
 
Join Date: Oct 2009
Posts: 24
merge require another table - yes? i want upsert for one row at time - can i do this?
Reply With Quote
  #4 (permalink)  
Old 10-27-09, 02:35
tonkuma tonkuma is offline
Registered User
 
Join Date: Feb 2008
Location: Japan
Posts: 2,193
You can use (VALUES ...) or (SELECT ... FROM sysibm.sysdummy1) for merging table(table-reference in USING clause).

Last edited by tonkuma; 10-27-09 at 02:43.
Reply With Quote
  #5 (permalink)  
Old 10-27-09, 13:46
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
The SQL standard (and DB2) calls this MERGE. UPSERT originates from the times where this functionality was not standardized yet.
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On