Re: PL/SQL trigger fires once a day

From: Jim Kennedy <kennedy-downwithspammersfamily_at_attbi.net>
Date: Sun, 08 Feb 2004 17:36:28 GMT
Message-ID: <wsuVb.245936$I06.2734633_at_attbi_s01>


"Jagdip Singh Ajimal" <jsa1981_at_hotmail.com> wrote in message news:c84eb1b0.0402080348.403d0328_at_posting.google.com...
> I am creating a table of appointments. As this table is going to get
> very large very quickly, I want to move the old appointments into a
> backup table, backupAppointments. How do I do this using a trigger? I
> have got this so far:
>
> create or replace trigger cleanAppointments
> after insert on appointments
> when apoointments.date < SYSDATE
> Begin
> -- move the records
> End;
>
> Any help would be greatly appriciated.

It wouldn't be a trigger. It would be a job. Use the dbms_job package to schedule this as a repeating stored procedure to run as often as you would like. (eg 1/day) See the documentation on supplied pl/sql packages.(this has been in Oracle since version 7)
Jim Received on Sun Feb 08 2004 - 18:36:28 CET

Original text of this message