void appendMergeClause(StringBuilder sb) {
        sb.append("MERGE INTO ");
        dialect.quoteIdentifier(sb, jdbcTable.getExternalNameList());
        sb.append(" TARGET USING (SELECT");
        Iterator<String> it = jdbcTable.dbFieldNames().iterator();
        while (it.hasNext()) {
            String dbFieldName = it.next();
            sb.append(" ? as ");
            dialect.quoteIdentifier(sb, dbFieldName);

            if (it.hasNext()) {
                sb.append(',');
            }
        }
        sb.append(" FROM dual) SOURCE");
        sb.append(" ON (");
        appendPrimaryKeys(sb);
        sb.append(")");
    }
@Test
    public void appendMergeClause() {
        OracleUpsertQueryBuilder builder = new OracleUpsertQueryBuilder(jdbcTable, dialect);
        StringBuilder sb = new StringBuilder();
        builder.appendMergeClause(sb);
        String mergeClause = sb.toString();
        assertThat(mergeClause).isEqualTo(
                "MERGE INTO \"table1\" TARGET "
                        + "USING (SELECT ? as \"field1\", ? as \"field2\" FROM dual) "
                        + "SOURCE ON (TARGET.\"pk1\" = SOURCE.\"pk1\" AND TARGET.\"pk2\" = SOURCE.\"pk2\")"
        );
    }