Subject Re: [firebird-support] firebird and a temporary data
Author Milan Babuskov
ik wrote:
> Is there a way in Firebird to tell it to store information only for specific
> amount of time (the table should remain, but not the content), so every X
> amount of time from insert it will delete all of the data that are 5 minutes
> old and older, or should I create a kind of daemon in Linux for it and do it
> outside ?

You have to do it outside, but it should be easy. Just create a simple
script that says:

DELETE FROM table1 WHERE data_timestamp < current_timestamp - X;

X is given in DAYS, so if you want 5 minutes put 0.00347222.

You can run this with "isql" inside via a cron job for example. Or write
a small shell script with infinite loop that runs isql and then calls
sleep(1) in each iteration.

Make sure you put an index on data_timestamp to make it work fast.

Milan Babuskov

The easiest way to import XML, CSV
and textual files into Firebird: