Results 1 to 5 of 5

Thread: upsert sql db2

  1. #1
    Join Date
    Oct 2009
    Posts
    24

    Unanswered: upsert sql db2

    i know other database have upsert. but not db2. why not db2?

  2. #2
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    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

  3. #3
    Join Date
    Oct 2009
    Posts
    24
    merge require another table - yes? i want upsert for one row at time - can i do this?

  4. #4
    Join Date
    Feb 2008
    Location
    Japan
    Posts
    3,483
    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 03:43.

  5. #5
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •