简体   繁体   English

从 informatica 工作流执行 informatica 存储库 sql

[英]Execute informatica repository sql from informatica workflow

I am new to Informatica.我是 Informatica 的新手。 I am using Informatica 10.1.0 and I have created a workflow like below.我使用的是 Informatica 10.1.0,我创建了一个如下所示的工作流程。

在此处输入图片说明

How can I make this workflow to execute the below informatica repository sql and fail the workflow is the count is greater than 0如何使此工作流执行以下 informatica 存储库 sql 并在计数大于 0 时使工作流失败

select count(*) as cnt 
from REP_TASK_INST_RUN
where workflow_run_id = (select max(workflow_run_id) from OPB_WFLOW_RUN where WORKFLOW_NAME = 'wf_Load_Customer_Transactions')
and RUN_STATUS_CODE <> 0

You have shared the view of a workflow manager.您已共享工作流管理器的视图。 in the Informatica Designer, you can create a mapping with the source as your table.在 Informatica Designer 中,您可以使用源作为表创建映射。 In the Source Qualifier, add a dummy query and then load this data into a designated target.在 Source Qualifier 中,添加一个虚拟查询,然后将此数据加载到指定的目标中。 Post that you can create the workflow for your mapping and run it.发布您可以为映射创建工作流并运行它。 https://www.guru99.com/mappings-informatica.html The above link should be a good reference. https://www.guru99.com/mappings-informatica.html上面的链接应该是很好的参考。

Once you have a functional workflow, you may add a control task for the above check in Control task to make the workflow to fail if count of target rows <1.一旦你有了一个功能性的工作流,你可以为上面的 check in Control 任务添加一个控制任务,使工作流在目标行数 <1 时失败。

Design an informatica Mapping- - SQ contains the query you have provided and output of SQ will be passed to an expression. Design an informatica Mapping- - SQ 包含您提供的查询,SQ 的输出将传递给表达式。 Create a mapping variable which stores this value.创建一个映射变量来存储这个值。 - with in the workflow using the post session workflow variable assignment- assign the mapping variable to workflow variable. - 在工作流中使用会话后工作流变量分配 - 将映射变量分配给工作流变量。 - create an assignment task which checks the value of this workflow variable- if the count >0 , use the control task to fail the workflow. - 创建一个分配任务,检查此工作流变量的值 - 如果计数 >0,则使用控制任务使工作流失败。

One way would be to create a mapping with your query inside of a SQL Transformation.一种方法是在 SQL 转换中使用您的查询创建映射。 Set it up to write to either a flat file or create a table in the DB.将其设置为写入平面文件或在数据库中创建表。 Add a filter to write the count to target only if it's greater than 0.添加过滤器以仅在计数大于 0 时将计数写入目标。

Then in the workflow, setup a session and link it to a Control Task that will fail if $TgtSuccessRows is < 1.然后在工作流中,设置一个会话并将其链接到一个控制任务,如果 $TgtSuccessRows < 1,该任务将失败。

You can create a dummy session to put your query inside the session, then link with the next workflow.您可以创建一个虚拟会话以将您的查询放入会话中,然后与下一个工作流程链接。 The linkage u can put $count=0.你可以把 $count=0 连接起来。 Then the next wkf session will run when the count is 0.然后下一个 wkf 会话将在计数为 0 时运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM