Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2003
    Posts
    102

    Unanswered: MERGE statement: skipping locked records

    HI,

    I was hoping if someone could confirm if it was possible to skip locked records in a MERGE statement and output the list of skipped records.


    Through the documentation, internet posts and testing, I believe it is NOT possible.
    MERGE acts like a single atomic DML statement, and therefore cannot avoid locked records.

    I can use the READPAST hint, which will skip the row-locked records. However, it could actually insert duplicate keys in certain cases (as it is ignoring records, i would guess), which would not be acceptable.


    Thanks!

  2. #2
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    You're correct about READPAST. It also will not work for you because it will not "record" the skipped records.
    "The data in a record depends on the Key to the record, the Whole Key, and
    nothing but the Key, so help me Codd."

Posting Permissions

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