[resolved] Run job based on Database value

One Star

[resolved] Run job based on Database value

Hi,
I have 2 jobs. I want to run one of them at a time. the decision to run it will depend on value stored in database.
How to do so?

Thanks! 
One Star

Re: [resolved] Run job based on Database value

Follow below steps to achieve your requirement
- Connect  DBcomponent to tFlowIterate component with main connection
- Connect tFlowToIterate to tJava component with Iterate connection
- Connect from tjava to tRunJob components using "Run If" Trigger 
Find attached screenschot for clear visualization. 
One Star

Re: [resolved] Run job based on Database value

Hi,
Just to  make the question clear.

I am designing a job. In which i receive files from a directory. I update a table with file name and id(generated in db).

Now i want to run the job after checking how many rows with same file name exist. (If count for filename is 1, insert data. if coiunt is 2 or more, delete last data and insert new ones).

How do i do this? (check if more than one row exist with same filename) and then execute consequent job depending on it.  
One Star

Re: [resolved] Run job based on Database value

 Modify your Db query with group by file name and use count variable in if condition.

2019 GARTNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

Have you checked out Talend’s 2019 Summer release yet?

Find out about Talend's 2019 Summer release

Blog

Talend Summer 2019 – What’s New?

Talend continues to revolutionize how businesses leverage speed and manage scale

Watch Now

6 Ways to Start Utilizing Machine Learning with Amazon We Services and Talend

Look at6 ways to start utilizing Machine Learning with Amazon We Services and Talend

Blog