Open ThuF opened 1 year ago
UPDATE FROM
should be changed into MERGE INTO
, perhaps during the migration.
https://answers.sap.com/questions/13455643/is-update-from-is-not-supporting-on-spa-hana-cloud.html
The Hana parser module should be modified to parse UPDATE FROM
(Hana platform) statements as now it understands only UPDATE
(HANA Cloud).
UPDATE "schema::T"
SET
T."DESCRIPTION_EN_US" = INP."cust_Description_en_US",
T."END_DATE" = INP."mdfSystemEffectiveEndDate",
T."STATUS" = INP."mdfSystemStatus",
T."IMPORT_RUN_AUDIT_ID" = :importRunAuditId,
T."REC_STATUS" = 1
FROM "...:entities.FO_BU" AS T
INNER JOIN :inpTable INP
ON T."EXTERNAL_CODE" = INP."externalCode"
AND T."START_DATE" = INP."effectiveStartDate";
→
MERGE INTO ".....::entities.FO_BU" AS T
USING :inpTable INP
ON (T."EXTERNAL_CODE" = INP."externalCode" AND T."START_DATE" = INP."effectiveStartDate")
WHEN MATCHED THEN UPDATE
SET
T."DESCRIPTION_EN_US" = INP."cust_Description_en_US",
T."END_DATE" = INP."mdfSystemEffectiveEndDate",
T."STATUS" = INP."mdfSystemStatus",
T."IMPORT_RUN_AUDIT_ID" = :importRunAuditId,
T."REC_STATUS" = 1;
Sample UPDATE FROM
migrations.
UPDATE T1
SET COL = ''
FROM "MY_TABLE" AS T1
INNER JOIN :INPUT_TABLE AS T ON T1.ID = T.ID;
→
MERGE INTO "MY_TABLE" AS T1
USING :INPUT_TABLE AS T ON T1.ID = T.ID
WHEN MATCHED THEN UPDATE
SET COL = '';
WHERE
clauseUPDATE T1
SET COL = ''
FROM "MY_TABLE" AS T1
INNER JOIN INPUT_TABLE AS T ON T1.ID = T.ID
WHERE T1.ID <> :V_DATA_ID;
→
MERGE INTO "MY_TABLE" AS T1
USING INPUT_TABLE AS T ON T1.ID = T.ID
WHEN MATCHED AND T1.ID <> :V_DATA_ID THEN UPDATE
SET COL = '';
JOIN
UPDATE T1
SET COL = ''
FROM "MY_TABLE" AS T1
WHERE T1.ID <> :V_DATA_ID;
→
UPDATE "MY_TABLE" AS T1
SET COL = ''
WHERE T1.ID <> :V_DATA_ID;
Migration solution:
Steps to reproduce:
Error:
StackTrace:
More details could be found: