Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: How to use timers

Re: How to use timers

From: fumi <fumi_at_tpts5.seed.net.tw>
Date: 18 Aug 1999 11:38:27 GMT
Message-ID: <7pe5vj$orb$3@news.seed.net.tw>

Kamel Hamard <hamard_at_iro.umontreal.ca> wrote in message news:CO2u3.2034$2a3.383167_at_carnaval.risq.qc.ca...
> Hi,
>
> I want to program the following application under Oracle:
>
> I have records which are inserted in a table A. Each inserted record has a
> insertion date.
> The table records A is visited every 24 houres and the records which are in
> the table for more 24 houres are deleted from the table A.
>
> Is it possible implement this mecanism only based on oracle ressource for
> example using timers and triggers?
>
> Thanks for any idea to do it.
>
> PS: I dont want to use a external program to pool the table A every 24
> houres to remove the records.
>
> Kamel.

  1. You can use DBMS_JOB package to schedule a job.
  2. You can use a trigger to delete the out-of-date rows, for example

CREATE TRIGGER MyTrigger
BEFORE INSERT ON MyTable
BEGIN
    DELETE FROM MyTable WHERE DateColumn<SYSDATE-1; END; Received on Wed Aug 18 1999 - 06:38:27 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US