469,643 Members | 1,486 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,643 developers. It's quick & easy.

PL/SQL trigger fires once a day

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.
Jul 19 '05 #1
1 2987

"Jagdip Singh Ajimal" <js*****@hotmail.com> wrote in message
news:c8**************************@posting.google.c om...
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
Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by timmy_dale12 | last post: by
9 posts views Thread by Lauren Quantrell | last post: by
7 posts views Thread by ZRexRider | last post: by
1 post views Thread by aj70000 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.