DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: Deletes at timed intervals

  1. #1
    Join Date
    Aug 2000
    Posts
    132
    Hi All,

    One of my developers has asked me to come up with a way to delete rows based on a timestamp. He wants the row to be deleted after 48 hours. I was thinking a stored procedure with DBMS_JOB running it at certain intervals. Is this overkill could I use a trigger - after insert if list_dt > SysDate + 48 then delete from...I'm not familar with stored procedures or DBMS_JOB so I don't want to bit off more than I have to. Thanks for the help.

  2. #2
    Join Date
    Aug 2000
    Location
    Toronto, Ontario Canada
    Posts
    52
    I believe you could use either approach.
    A stored procedure may be easier to do...

    Basically, check the sysdate against your required time.
    ie.
    select sysdate from dual into v_time;
    if v_time > some_other_variable;
    dont_do_procedure;
    else
    d_procedure;

    There may be other ways too...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width