如何在 informatica powercenter 中基于空键查找表

问题描述 投票:0回答:2

大家好,我有两张桌子

table 1
---------------
col1 col2 col3
NULL  1    update
123   1    y
159   2    f
table 2
----------------------
col1 col2 col3
NULL  1    x
123   1    z

我希望我的表 2 像这样更新

table 2
---------------
col1 col2 col3
NULL  1    update
123   1    y
159   2    f

我尝试了 3 种方法,但没有一个对我有用 我在会话属性中尝试了第一种方法

treat source rows as: update
并且
update else insert in table 2 options 
它在除第 1 行之外的所有行中都有效,它插入而不是更新 我尝试使用第二种方法
table 2 as a lookup and use update startegy to insert or update based on a table 1 cols to be null insert else update 
但它给了我与第一种方法相同的输出
it treated row 1 as insert not update
所以我认为问题是它可以在连接条件中使用 col1 因为空值

所以我尝试了第三种方法:将表2拖为源,并在2个表中的col1上执行表达式,表2上的左连接并根据表1的cols更新startegy,如果为空则插入其他更新,但这里的问题我可以' t 将原始列传递给更新 startegy,因为它是

disallowed concatenation between active joiner transformation and source qualifier
我只需要表达式即可成功连接,并且我将使用不带表达式的原始列,所以我如何解决类似的问题

oracle etl lookup informatica-powercenter joiner
2个回答
0
投票

concatenation disallowed
错误基本上意味着由于行号或排序可能存在差异,您无法合并两个流程。

您需要使用木工。同时你不能加入 null。

我的想法是:读取具有

null
值的行,用不太可能看到的内容替换端口中的空值,例如
-1
,然后插入这些行。接下来,作为 PostSQL 语句,我将删除带有空值的旧行并将
-1
更新为
null

这是总体思路。您可能需要弄清楚细节。


0
投票

Null 不能被视为 key,更新策略不允许你基于 null 值进行更新。

如果您要更新,更新后是您更新空键列的唯一选项。

如果您要更新行,建议将值视为主键。

如果您尝试插入新表,则可以使用NVL功能,因为您的源是Oracle,当它为空时定义一个默认值。但要更新任何记录,您必须有一个值。

© www.soinside.com 2019 - 2024. All rights reserved.