DELETE case is not being considered in the temporary table
Description
There is an INSERT statement pattern that requires a specific transformation, which involves the creation of a temporary table. This FDM notifies that the DELETE case is not considered in the transformation mentioned. Please visit INSERT with Table DML Factor with MERGE as DML to get more information about this pattern.
Input Code:
IN -> SqlServer_01.sql
INSERT INTO T3SELECT col1, col2FROM (MERGE T1 USING T2ON T1.col1 = T2.col1WHENNOTMATCHEDTHENINSERTVALUES ( T2.col1, T2.col2 )WHENMATCHEDTHENUPDATESET T1.col2 = t2.col2OUTPUT $action ACTION_OUT, T2.col1, T2.col2) AS MERGE_OUTWHERE ACTION_OUT='UPDATE';
Output Code:
OUT -> SqlServer_01.sql
--** SSC-FDM-TS0026 - DELETE CASE IS NOT BEING CONSIDERED, PLEASE CHECK IF THE ORIGINAL MERGE PERFORMS IT **CREATEORREPLACE TEMPORARY TABLE MERGE_OUT ASSELECTCASEWHEN T1.$1ISNULLTHEN'INSERT'ELSE'UPDATE'END ACTION_OUT, T2.col1, T2.col2FROM T2LEFT JOIN T1ON T1.col1 = T2.col1;MERGEINTO T1USING T2ON T1.col1 = T2.col1WHENNOTMATCHEDTHENINSERTVALUES (T2.col1, T2.col2)WHENMATCHEDTHENUPDATESET T1.col2 = t2.col2 !!!RESOLVE EWI!!! /*** SSC-EWI-0021 - OUTPUT CLAUSE NOT SUPPORTED IN SNOWFLAKE ***/!!!OUTPUT $action ACTION_OUT, T2.col1, T2.col2 ;INSERT INTO T3SELECT col1, col2FROM MERGE_OUTWHERE ACTION_OUT ='UPDATE';