Results 1 to 7 of 7
  1. #1
    Join Date
    Mar 2009
    Posts
    4

    Unanswered: how to set a time to repeat a trigger in mysql

    hi everyone,
    i have created one trigger in my database. i want to set a fixed time limit to repeat that trigger. is there any process? pls give me a valuable reply....

  2. #2
    Join Date
    Jun 2007
    Location
    London
    Posts
    2,527
    Quote Originally Posted by rajasekhar1242
    hi everyone,
    i have created one trigger in my database. i want to set a fixed time limit to repeat that trigger. is there any process? pls give me a valuable reply....
    Triggers get called when you do an update/insert/delete to a table. They don't get called at a fixed time. The best way of doing what you're after is to use a stored procedure and then call it from a unix shell script perhaps using cron jobs for the timing.

  3. #3
    Join Date
    Mar 2009
    Posts
    4
    yes ur right... triggers generates whenever we do the insert,update and delete operations... but let me explain my problem, i have to write one trigger to get the changes in database. we are using 4 mac's to develop coding part and one more system to maintain a database. all these systems are connected in LAN. they are using AIRPORT connectivity to communicate with other systems...
    some times we may loss connectivity so, that my trigger will repeat based on the time limit to get the changes....

  4. #4
    Join Date
    Jun 2007
    Location
    London
    Posts
    2,527
    Quote Originally Posted by rajasekhar1242
    but let me explain my problem, i have to write one trigger to get the changes in database. we are using 4 mac's to develop coding part and one more system to maintain a database. all these systems are connected in LAN. they are using AIRPORT connectivity to communicate with other systems...
    just write a small procedure to send SQL to database, procedure checks that SQL ran OK, if it didn't then retry the SQL. After x failed attempts then generate an error.

  5. #5
    Join Date
    Mar 2009
    Posts
    3

    mysql events

    Triggers get called when you do an operation on table like update insert delete. i think ur requirement u have to do something on table for some time interval. U can do this job by using MYSQL EVENTS. this future is introduced in mysql latest version(7.0). ok good luck....

  6. #6
    Join Date
    Mar 2009
    Posts
    11
    Events were introduced in Version 5.1.
    (Although I actually have never used them - I will now).

    Quote Originally Posted by suresh_emmani
    Triggers get called when you do an operation on table like update insert delete. i think ur requirement u have to do something on table for some time interval. U can do this job by using MYSQL EVENTS. this future is introduced in mysql latest version(7.0). ok good luck....

  7. #7
    Join Date
    Jun 2007
    Location
    London
    Posts
    2,527
    U can do this job by using MYSQL EVENTS
    Has anyone actually used MySQL events? and were they a good solution to a real problem?

    I just don't see much on the web promoting them as an answer. Because they run in the background of MySQL it's difficult to tell that they even exist let alone whether they completed fine or failed. Hiding logic within a system always seems like a bad thing to me.

    I accept that cron jobs run in the background but they have always been a part of unix and most batch jobs use them. It's also easy to log what happens and record the success or failure of these jobs. I suspect the ability to time events is more mature with cron as opposed to MySQL.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •