Better startIndex calculation
This commit is contained in:
parent
9bafa2f158
commit
f4b9b2a406
1 changed files with 2 additions and 2 deletions
|
@ -305,12 +305,12 @@ func BuildUpsertQueryMSSQL(dia Dialect, tableName string, primary, update, inser
|
|||
}
|
||||
fmt.Fprint(buf, ")\n")
|
||||
|
||||
startIndex = len(primary) + 1
|
||||
startIndex += len(primary)
|
||||
|
||||
fmt.Fprint(buf, "WHEN MATCHED THEN ")
|
||||
fmt.Fprintf(buf, "UPDATE SET %s\n", strmangle.SetParamNames(string(dia.LQ), string(dia.RQ), startIndex, update))
|
||||
|
||||
startIndex = len(primary) + 1 + len(update)
|
||||
startIndex += len(update)
|
||||
|
||||
fmt.Fprint(buf, "WHEN NOT MATCHED THEN ")
|
||||
fmt.Fprintf(buf, "INSERT (%s) VALUES (%s)",
|
||||
|
|
Loading…
Add table
Reference in a new issue