Reputation: 47
I am using Informatica PC. I have workflow which have sql query. This query like "select t1, t2, t3 from table where t1 between date '2020-01-01' and date '2020-01-31'" I need to download all data between 2020 and 2022. But I can't write it in query because I will have ABORT SESSION from Teradata. I want to write smth, which will restart workflow with different dates automatically. From first start take 01.2020, second start 02.2020, third start 03.2020 and etc. How can I solve this problem?
Upvotes: 1
Views: 75
Reputation: 7387
This is a long solution and can be achieved in two ways. Using only shell script will give you lot of flexibility.
First of all parameterize your mapping with two mapping parameter. Use them in SQL like below.
select t1, t2, t3 from table where t1 between date '$$START_DT' and date '$$END_DT'
Idea is to change them at each run.
2020-01-01,2020-01-31
2020-02-01,2020-02-29
2020-03-01,2020-03-31
[folder.workflow.session_name]
$$START_DT=2020-01-01
$$END_DT=2020-01-31
Use file(file1) in a pmcmd to kick off informatica workflow. Pls add --wait
so it waits for this to complete.
Loop above steps until all entries of master file are complete.
Upvotes: 1