Friday, May 17, 2013

How to Resume a Failed Workflow in Informatica

I am pleased to write this article, as today I have figured out a very important feature of Informatica. I was in a Informatica user group meeting about a month ago. We discussed there that the other organizations are using a third party scheduling tool to schedule workflows of Informatica. I asked them why they do so and they replied that if something fails in the middle of the workflow, there is no way to resume the workflow from the point they want it. They need to run the whole workflow again. Well, that's not true. There is a way to resume the execution of a workflow. 

Here is what we need to do in order to resume a workflow execution. 
  • Open the workflow in workflow manager. 
  • Right click on the task you want to resume execution from.
  • Click on the 'Start Workflow from Task' option.
That's it. 
This will run all the tasks after it, that means all the way down. Note that if there is anything which do not have dependency on it or not in the downstream, will not be executed.


Wednesday, May 15, 2013

How to find the max column value from more than one tables

I was needed to find out the maximum value for a column from 16 tables. The column was ROW_LAST_MODIFIED_THIS and I was needed to compare it with a source table field value, which contains the row_last_modified value at source side. The idea behind was to compare both the fields and get only records which are new or updated later than the max modification date. Here is how I figured it out:



SELECT * FROM table WHERE
 table.ROW_LAST_MODIFIED > NVL((select max(a) from(
(SELECT MAX(row_last_modified_this) as a
FROM table1) union all
(SELECT MAX(row_last_modified_this) as a
FROM table2) union all
(SELECT MAX(row_last_modified_this) as a
FROM table3) union all
(SELECT MAX(row_last_modified_this) as a
FROM table4) union all
(SELECT MAX(row_last_modified_this) as a
FROM table5) union all
(SELECT MAX(row_last_modified_this) as a
FROM table6) union all
(SELECT MAX(row_last_modified_this) as a
FROM table7) union all
(SELECT MAX(row_last_modified_this) as a
FROM table7) union all
(SELECT MAX(row_last_modified_this) as a
FROM table8) union all
(SELECT MAX(row_last_modified_this) as a
FROM table9) union all
(SELECT MAX(row_last_modified_this) as a
FROM table10) union all
(SELECT MAX(row_last_modified_this) as a
FROM table11) union all
(SELECT MAX(row_last_modified_this) as a
FROM table12) union all
(SELECT MAX(row_last_modified_this) as a
FROM table13) union all
(SELECT MAX(row_last_modified_this) as a
FROM table14)))
                                ,SYSDATE-36500)

You can use it with any number of tables. The field you are comparing should contain the similar value, like in this example it is date. Hope it will help :)