You can translate the question and the replies:

Run a job if one column from a CSV file is Y

I have a job that cached a base view. And I have a CSV file that is similar to this: | origin | active | | -------- | -------- | | SAP | N | | Oracle | N | | DB1 | Y | | DB2 | Y | | DB3 | Y | I would like that this job was executed only if the origin is like 'DB%' and active=Y how can I do that? Thanks.
user
08-06-2020 13:27:52 -0400

1 Answer

Hi, For your case, I would suggest you to create the CSV file as a view say **'view1'** and create a derived view **'view2'** over the view **'view1'** which would return the count of the rows when the where the condition is met(origin like 'DB%' AND active = 'Y'). Then create another view **'view3'** with a case condition to return a numeric value say 1 when count is greater than 0 else return a text value say ‘text’ i.e the **'view3'** will either return either 1 or ‘text’. Now, create two scheduler jobs one for the **'view3'** and one for the VDPcache job, and create dependencies between two jobs in the trigger section. This way when the first job is errored then the dependent job will not start. You may refer to the section [Dependencies Among Jobs](https://community.denodo.com/docs/html/browse/latest/scheduler/administration/creating_and_scheduling_jobs/configuring_new_jobs/dependencies_among_jobs#dependencies-among-jobs) for more information. In the extraction section of the first job create a parameterized query to read the value of 'view3', like below: Select @cnt+1 from dual(); Map the parameter cnt with the value returned by 'view3'. This way, when 'view3' returns a numeric value then the job will succeed and the dependent cache job will start else it will fail with an error and the dependent cache job with not start. Hope this helps!
Denodo Team
10-06-2020 08:11:09 -0400
You must sign in to add an answer. If you do not have an account, you can register here