You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Oracle MERGE doesn't support returning entities
39
+
if(returnedColumns.Count!=0)
40
+
{
41
+
thrownewNotSupportedException("Oracle MERGE does not support returning entities. Use ExecuteBulkInsertAsync without returning results when using conflict resolution.");
42
+
}
43
+
38
44
IEnumerable<string>matchColumns;
39
45
if(onConflictTyped.Match!=null)
40
46
{
@@ -49,27 +55,21 @@ public override string BuildMoveDataSql<T>(
49
55
thrownewInvalidOperationException("Table has no primary key that can be used for conflict detection.");
50
56
}
51
57
52
-
q.AppendLine($"MERGE INTO {target.QuotedTableName} AS {PseudoTableInserted}");
58
+
// Oracle MERGE syntax does NOT use AS for table aliases
59
+
q.AppendLine($"MERGE INTO {target.QuotedTableName}{PseudoTableInserted}");
53
60
54
61
q.Append("USING (SELECT ");
55
62
q.AppendColumns(insertedColumns);
56
-
q.Append($" FROM {source}) AS {PseudoTableExcluded} (");
57
-
q.AppendColumns(insertedColumns);
58
-
q.AppendLine(")");
59
-
60
-
q.Append("ON ");
61
-
q.AppendJoin(" AND ",matchColumns,(b,col)=>b.Append($"{PseudoTableInserted}.{col} = {PseudoTableExcluded}.{col}"));
63
+
// Oracle MERGE syntax does NOT use AS for subquery aliases
64
+
q.Append($" FROM {source}) {PseudoTableExcluded}");
0 commit comments