Sarath Subramanian
Sarath Subramanian

Reputation: 21281

Execute informatica repository sql from informatica workflow

I am new to Informatica. I am using Informatica 10.1.0 and I have created a workflow like below.

enter image description here

How can I make this workflow to execute the below informatica repository sql and fail the workflow is the count is greater than 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

Upvotes: 1

Views: 1498

Answers (4)

cc hoo
cc hoo

Reputation: 11

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. Then the next wkf session will run when the count is 0.

Upvotes: 0

RadhikaChhabra
RadhikaChhabra

Reputation: 31

You have shared the view of a workflow manager. in the Informatica Designer, you can create a mapping with the source as your table. In the Source Qualifier, add a dummy query and then load this data into a designated target. 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.

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.

Upvotes: 3

hello123
hello123

Reputation: 11

Design an informatica Mapping- - SQ contains the query you have provided and output of SQ will be passed to an expression. 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.

Upvotes: 1

stickabee
stickabee

Reputation: 145

One way would be to create a mapping with your query inside of a SQL Transformation. 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.

Then in the workflow, setup a session and link it to a Control Task that will fail if $TgtSuccessRows is < 1.

Upvotes: 0

Related Questions