How to delete records between a start and end date using sys_auto_flush?

TEJAS
Tera Contributor

Hi everyone,

I’m leveraging the sys_auto_flush table to automate record deletions in a scoped application. For most scenarios, I calculate the age field based on standard timeframes (like "last X days"), and everything works as expected.

However, I’m trying to support a use case where users define a custom date range with a start and end date.

To implement this, I currently calculate age as the difference (in seconds) between the current time and the end date, with the assumption that sys_auto_flush will delete records older than that end date.

This works in deleting records older than the end date, but what I really need is to delete records only between the start and end dates — not beyond.


Question:

Is it possible to configure sys_auto_flush to target only records within a specific date range (start to end).

Appreciate any best practices or suggestions others have used for similar requirements!

Thanks in advance


5 REPLIES 5

Anurag Tripathi
Mega Patron
Mega Patron

Auto flush will delete everything before a certain date.

I guess you can use data management 

AnuragTripathi_0-1747390520300.png

Schedule or execute a job to delete records

 

here you should be able to specify the date range. Please do test it in lower instance before deleting anything in production.

-Anurag

Chaitanya ILCR
Mega Patron

Hi @TEJAS  ,

 

if it is one time activity use the data management delete job as suggested by @Anurag Tripathi 

 

try is approach for table cleaner

 

ChaitanyaILCR_0-1747390927468.png

 

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya

TEJAS
Tera Contributor

@Anurag Tripathi and @Chaitanya ILCR 
I am looking for this condition in script include because i am using dynamically (i am not using for one table i am using for sys_db_object it is a variable )
So can you help me in how can i write a condition in script include 

 

Pass the variable (table name) and the condition builder as encoded query, im not sure where are you stuck?

-Anurag