uiyo_90_09
Sep 24, 2007, 02:45 AM
How to write a trigger that will be executed on a specific date/day of every month/week?
If you have any example, please describe.
benn11
Sep 24, 2007, 06:22 AM
Check this out, It explains the whole concept very well >> (http://www.adp-gmbh.ch/ora/sql/create_trigger.html)
jstrike
Oct 4, 2007, 07:08 AM
how to write a trigger that will be executed on a specific date/day of every month/week?
If you have any example, please describe.
Triggers are executed in response to an action on a table (typically but not limited to, add,modify and delete) not an external event like date/time. For example you could setup a trigger so that when you modify a column on table A the trigger would run some sql that would perform another action on table B. If there is a trigger on table B, that trigger could fire off some more SQL, etc...
If you need to execute some SQL code at a specific time a trigger is not the way to do it. Write a small application in the language of your choice that will connect to the database and execute the SQL then setup a timer (such as cron) to run that program when you want. It's also a good idea to include logging in the application so you can check the status/success.
HTH.