Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Oracle (https://www.askmehelpdesk.com/forumdisplay.php?f=443)
-   -   Database date event trigger (https://www.askmehelpdesk.com/showthread.php?t=133067)

  • Sep 24, 2007, 02:45 AM
    uiyo_90_09
    Database date event trigger
    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.
  • Sep 24, 2007, 06:22 AM
    benn11
    Check this out, It explains the whole concept very well >>
  • Oct 4, 2007, 07:08 AM
    jstrike
    Quote:

    Originally Posted by uiyo_90_09
    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.

  • All times are GMT -7. The time now is 06:23 AM.