[英]previous record end date update in informatica using next record start date
I have a problem regarding update of end date of previous record using the next records start date. 我有一个关于使用下一个记录开始日期更新上一个记录的结束日期的问题。 The problem is both the records coming in, in the same table load.
问题是两条记录都以相同的表负载进入。 Also there is no unique row identifier except the combination of all columns.
除了所有列的组合之外,没有唯一的行标识符。 Example: Source Table
示例:源表
HICN FIRST_NAME LAST_NAME M_NAME DOB(string) START_DATE X123 ABC DEF M ' 19600101 1/1/2013 Y456 ABC DEF M 19600101 2/2/2014Now, (this is my business requirement, nothing I can do about it) In the target I have an extra column END DATE.
\nHICN FIRST_NAME LAST_NAME M_NAME DOB(string) START_DATE END DATEHICN FIRST_NAME LAST_NAME M_NAME DOB(字符串)START_DATE END DATE\nX123 ABC DEF M ' 19600101 1/1/2013 2/2/2014
X123 ABC DEF M'19600101 2013年1月1日2014年2月2日\nY456 ABC DEF M 19600101 2/2/2014 12/31/1990
Y456 ABC DEF M 19600101 2/2/2014 12/31/1990\n
I have figured out how to update date cols and flag(which i did not mention above for active and inactive hicn for a member) for a second run but not sure how to do this if both the records come in the same batch. 我已经想出了第二次运行如何更新日期cols和flag(我在上面没有提到的成员的活动和非活动hicn),但是不确定如果两个记录都在同一批中时该怎么做。 Any help would be greatly appreciated.
任何帮助将不胜感激。 Thanks
谢谢
Try these options: 尝试以下选项:
Create a column in target table like ROW_ID with VARCHAR2(100) 在目标表中使用VARCHAR2(100)在ROW_ID之类的表中创建一列
Create an Expression in Expression transformation with following - 使用以下命令在Expression转换中创建一个Expression-
MD5(Col1||' '||col2||' '||...etc) MD5(Col1 ||' '|| col2 ||' '|| ...等)
'*' - is an separator to get precised output '*'-是获取精确输出的分隔符
This MD5 function will generate an 32 bit mask which we will use it in next steps 此MD5函数将生成一个32位掩码,我们将在后续步骤中使用它
Have a Dynamic lookup on the target table 在目标表上进行动态查找
Now, every time when you receive a new row it will get added to target as well as Dynamic lookup . 现在,每当您收到新行时,它将被添加到目标以及动态查找中 。 Hence, if you try to Match the ROW_ID field with 2nd rows calculated ROW_ID, you can easily find out the duplicate record.
因此,如果您尝试将ROW_ID字段与计算出的第二行ROW_ID进行匹配,则可以轻松地找到重复的记录。
MD5 is one of the best and fastest way to find dups using whole column list. MD5是使用整个列列表查找重复项的最好,最快的方法之一。 DO NOT foget to create Dynamic Lookup otherwise you wont be able to find dups.
不要急于创建动态查找,否则您将无法找到公仔。
Let me know if you need further info. 让我知道您是否需要更多信息。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.