title: SQL MERGE to update or insert values into same table
body: <pre><code>"MERGE INTO NT_PROPERTY ntProp USING ( "  +
                              "SELECT * FROM NT_PROPERTY ) " +
                              "VALUES " +
                                      "('minDPTObjectId'," + minDPTObjectId + ", 'Starting DPT Object Id') " +
                                      "('maxDPTObjectId', " + maxDPTObjectId + ", 'Ending DPT Object Id') " +
                              "vt (NAME, VALUE, NOTE) " +
                              "ON ( ntProp.NAME = vt.NAME ) " +
                              "WHEN MATCHED THEN " +
                              "UPDATE SET VALUE = vt.VALUE "+
                              "WHEN NOT MATCHED THEN " +
                              "INSERT (NAME, VALUE, NOTE) VALUES (vt.NAME, vt.VALUE, vt.NOTE)";
  </code></pre>
  
  <p>Well I'm getting a missing ON keyword error and with no clue what so ever, also is there any other way to make it less clumsy</p>
  
  <p>Help is very much appreciated.</p>