How to delete records between a start and end date using sys_auto_flush?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2025 03:08 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2025 03:16 AM
Auto flush will delete everything before a certain date.
I guess you can use data management
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2025 03:22 AM
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
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2025 05:22 AM
@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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2025 05:44 AM
Pass the variable (table name) and the condition builder as encoded query, im not sure where are you stuck?