Skip to content

Commit

Permalink
Merge pull request #368 from datayoga-io/367-relationalwrite-malforme…
Browse files Browse the repository at this point in the history
…d-merge-statement-for-oracle-and-sqlserver-for-multiple-keys

`relational.write` - Malformed MERGE statement for Oracle and SQLServer for multiple keys #367
  • Loading branch information
zalmane authored May 19, 2024
2 parents 9cfc402 + 6e5199f commit 252db0c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/src/datayoga_core/blocks/relational/write/block.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def generate_upsert_stmt(self) -> Any:
relational_utils.construct_table_reference(self.tbl, with_brackets=True),
", ".join([f"{sa.bindparam(column)}" for column in self.business_key_columns]),
", ".join([f"[{column}]" for column in self.business_key_columns]),
"AND ".join([f"target.[{column}] = source.[{column}]" for column in self.business_key_columns]),
" AND ".join([f"target.[{column}] = source.[{column}]" for column in self.business_key_columns]),
", ".join([f"[{column}]" for column in self.columns]),
", ".join([f"{sa.bindparam(column)}" for column in self.columns]),
", ".join([f"target.[{column}] = {sa.bindparam(column)}" for column in self.mapping_columns])
Expand All @@ -166,7 +166,7 @@ def generate_upsert_stmt(self) -> Any:
WHEN MATCHED THEN UPDATE SET %s
""" % (
relational_utils.construct_table_reference(self.tbl),
"AND ".join([f"target.{column} = :{column}" for column in self.business_key_columns]),
" AND ".join([f"target.{column} = :{column}" for column in self.business_key_columns]),
", ".join([f"{column}" for column in self.columns]),
", ".join([f"{sa.bindparam(column)}" for column in self.columns]),
", ".join([f"target.{column} = {sa.bindparam(column)}" for column in self.mapping_columns])
Expand Down

0 comments on commit 252db0c

Please sign in to comment.