Oracle sql query, parametric datetime duration, orchestrator schedule

Hi,
I have a query, that is
“select * from sr_table sr
where sr.start_date>01/05/2019
and sr.start_date<01/06/2019”

I want to schedule this query to run every month and the duration given above to be inserted with parameters.

For example, at 1/07/2019, the two parameters will take values 1/06/2019-1/07/2019
at 1/08/2019, the two parameters will take values 1/07/2019-1/08/2019 etc

I have read different topics mentioned to the forum with suggestions such as set variables i.e
“select * from sr_table sr
where sr.start_date>? or var1
and sr.start_date<? or var2”
but i dont know how to relate these variables with scheduler etc

Thanks in advance

Hi @dimv

Welcome to uipath community, Thats a good question to start with
–To execute these sort of sql query use Execute activity under database activities and to get this package
go to → Design tab > manage packages > in official tab > Uipath.Database.Activities
–in Execute activity mention the query as a string within double quotes and get the output with a variable of type datatable named out_dt
–while to variables in this query we can mention like this
“select * from sr_table sr
where sr.start_date> @variablename1
and sr.start_date< @variablename2

where variablename1 = DateTime(now.Year,now.Month,1).ToString(“dd/MM/yyyy”)
and variablename2 = DateTime(now.Year,now.Month,1).AddMonth(1).ToString(“dd/MM/yyyy”)

–To schedule this regular we need to connect our machine to orchestrator and for more on this
https://orchestrator.uipath.com/docs/managing-schedules

Cheers @dimv