I have a requirement to delete 30 days old record in DB2. I used below code to delete, It worked fine but current timestamp keep changing. This cause my procedure to go on loop.
DELETE FROM TABLE
WHERE TIMESTAMP_FIELD < CURRENT TIMESTAMP - 31 DAYS
I'm using my procedure as generic delete, So I will not able to use host variable. I tried subdate ADDDATE but no luck.
Please help me out.
Thanks