I have an input SQL tool. As per our database, the query is set to time out after 30 mins, and the data is fairly large.
So far, I have been using multiple SQL input tools for the same query, by splitting them by dates so that they all work independently and do not time out-
EG - FIRST INPUT TOOL
SELECT * FROM A
LEFT JOIN B on [condition]
WHERE A.DATE_OPEN>='2020-01-01' AND A.DATE_OPEN <'2020-02-01'
AND B.DATE_APPLIED>='2020-01-01' ----This pulls data for January from table A, and everything after January from Table B
SECOND INPUT TOOL
SELECT * FROM A
LEFT JOIN B on [condition]
WHERE A.DATE_OPEN>='2020-02-01' AND A.DATE_OPEN <'2020-03-01'
AND B.DATE_APPLIED>='2020-02-01' ---This pulls data for February from table A, and everything after February from Table B
As you can see, the query is exactly the same, but my Date Range on the ''DATE_OPEN" field changes. The problem with this is, as the data steadily grows, I have to keep adding input tools for each month. If ever I have to change my main query, I have to change it in every single input tool. Is there a way to achieve this so that it loops through the query with just changing the date range?
@vertika
Maybe with a batch macro?
A text Input tool will be the input and the dates will be replaced one by one inside the macro.
Sorry I dont have the resource to test.