Check database change

How can i check a change in my database

Hi @Tapiwa

We can use database Activities like execute query and run the query where we will getting an output of datatable named outdt
With
Outdt.rows.count
Value we can check the change in the number of rows in the table in database
Cheers @Tapiwa

1 Like

thanks @Palaniyappan
It will count the number of rows in the database. Which condition can i have for my bot to check every 2 mins in my database

@Tapiwa

To continually have it check every 2 minutes, you can surround Palaniyappan’s activity with a While activity with the condition set to true, the last activity in the while loop would be a ‘Delay’ activity set to 2 minutes.

1 Like

okay… soo when it processes the last activity it will wait for the 2 mins(delay) then checks again and soo on and soo on

@Tapiwa

Yes

thanks @Palaniyappan and @nlee1131

2 Likes

No problem, if these solved your issue kindly mark one as the solution.

Well I would like to suggest you one thing on this…

– use a assign Activity with a timestamp till next day like this
In_datetime = now
Where in_datetime is a variable of type Datetime
–Use a while loop and a condition like this
In_datetime>Now.AddDay(1)
Which means the loop will run every hour or min we want to run with a gap between till the next day (even that day limit can be changed)
–inside this use a execute query with query that fetch all the records from a table from database and output would be a datatable named outdt
–use write line Activity with this
Outdt.Rows.count.tostring
–use delay option with this value in time property
01:00:00
This will till one hour and again the while loop will run again and again

Cheers @Tapiwa

1 Like

Kindly try and let know for any queries buddy
Cheers @Tapiwa

Did that work buddy @Tapiwa

@Palaniyappan its working properly. Non stopping. Just a few changes. In_datetime<Now.AddDay(1) and In_datetime>Now.AddDays(1) otherwise everything is perfect.

Thanks Buddy

1 Like

Fantastic
Cheers @Tapiwa

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.