The Artima Developer Community
Sponsored Link

Java Answers Forum
Database auto deletion of rows

1 reply on 1 page. Most recent reply: Sep 6, 2006 12:08 AM by Matthias Neumair

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Rajeev Mutalik

Posts: 57
Nickname: rajmutalik
Registered: Sep, 2002

Database auto deletion of rows Posted: Sep 5, 2006 10:11 PM
Reply to this message Reply
Advertisement
Hi,

I have got a table which will hold dyanamic information in it. The data in that table will not be required for more than two days. So at the end of the day, I want to remove/delete those records which are no longer valid or required. I dont want to run any external command or any other application to do this. But I want to know, can this be done through using the database feature itself like writing triggers or anything similar to that.

Thanks in advance.

Regards,
Mutalik


Matthias Neumair

Posts: 660
Nickname: neumi
Registered: Sep, 2003

Re: Database auto deletion of rows Posted: Sep 6, 2006 12:08 AM
Reply to this message Reply
Depends on the database, but basically: YES

The important thing is that every record contains information about when it expires or was last modified (no problem with Gpta DBs).

Create a stored procedure with a filter which controls the last_modified field.

Then create a timer to run this stored procedure every day or so.

Flat View: This topic has 1 reply on 1 page
Topic: JavaScript Contest Previous Topic   Next Topic Topic: JLabel and default web browser

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use