【问题标题】:SCD Type - 2 implementation in IICS (Informatica Cloud)SCD Type - IICS (Informatica Cloud) 中的 2 实施
【发布时间】:2020-03-24 19:04:41
【问题描述】:

我是 IICS 的新手。有人请帮我实现 SCD 类型 2 吗?或任何演练教程网络链接。 提前致谢。

【问题讨论】:

    标签: cloud etl informatica informatica-cloud


    【解决方案1】:

    我已经使用代码实现并通过 Informatica 调用

    创建两个表

    select * from db.Customer_Source
    select * from EDW.Customer_Master
    
    
    
    
    
    INSERT INTO dbo.Customer_Master           --Insert into master 
    SELECT
        Source_Cust_ID,
        First_Name,
        Last_Name,
        Eff_Date,
        End_Date,
        Current_Flag
    FROM
        ( MERGE EDW.Customer_Master CM
            USING EDW.Customer_Source CS                                             
        ON (CM.Source_Cust_ID = CS.Source_Cust_ID)                                
        
        WHEN NOT MATCHED THEN
            INSERT VALUES (CS.Source_Cust_ID, CS.First_Name, CS.Last_Name,
            convert(char(10), getdate()-1, 101), '12/31/2199', 'y')                         -- if not match then insert new values
            
        WHEN MATCHED AND CM.Current_Flag = 'y' AND (CM.Last_Name <> CS.Last_Name ) THEN            -- if match then it will insert new row and fkag records as "Y" and old one as "N" 
             UPDATE SET CM.Current_Flag = 'n', CM.End_date = convert(char(10), getdate()-2, 101)
        OUTPUT $Action Action_Out,
                CS.Source_Cust_ID,
                CS.First_Name,
                CS.Last_Name,
                convert(char(10), getdate()-1, 101) Eff_Date,
                '12/31/2199' End_Date,
                'y'Current_Flag)
    AS MERGE_OUT
    WHERE MERGE_OUT.Action_Out = 'UPDATE';
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-09-19
      • 2021-11-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-05-08
      • 2020-04-22
      相关资源
      最近更新 更多