我正在寻找有关 Informatica 中循环的信息。具体来说,我需要检查源表是否已加载,如果已加载,则转到下一步,如果没有,请等待 X 分钟并再次检查状态表。我更喜欢一个可以自己学习的地方,但我需要确认这是可能的,因为我在谷歌搜索中没有找到任何东西。
最佳答案
您可以使用简单的 shell 脚本来执行此等待和监视功能。
#/bin/sh
# call it as script_name.sh
# it will wait for 10 min and check again for data, in total it will wait for 2hours. change them if you want to
# Source is assumed as oracle. change it as per your source.
interval=600
loop_count=10
counter=0
while true
do
$counter=`expr $counter + 1 `
db_value=`sqlplus -s user/pass@local_SID <<EOF
set heading off
set feedback off
SELECT count(*) FROM my_source_table;
exit
EOF`;
if [ $db_value -gt 0 ]; then
echo "Data Found."
exit 0
else
if [ $counter -eq $loop_count ]
then
echo "No data found in source after 2hours"
exit 1
else
sleep $interval
fi
fi
done
并将此 shell 脚本(在 CMD 任务中)添加到工作流程的开头。
然后使用 informatica 链接条件,如果 status= 0,则继续发送等待时间结束的电子邮件。
可以引用下图。如果等待时间结束并且源中仍然没有数据,这将发送一封邮件。
关于Informatica 循环,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70975772/