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!