If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > how to set a time to repeat a trigger in mysql

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-12-09, 06:19
rajasekhar1242 rajasekhar1242 is offline
Registered User
 
Join Date: Mar 2009
Posts: 4
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....
Reply With Quote
  #2 (permalink)  
Old 03-12-09, 07:57
mike_bike_kite mike_bike_kite is offline
vaguely human
 
Join Date: Jun 2007
Location: London
Posts: 2,519
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.
Reply With Quote
  #3 (permalink)  
Old 03-12-09, 08:44
rajasekhar1242 rajasekhar1242 is offline
Registered User
 
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....
Reply With Quote
  #4 (permalink)  
Old 03-12-09, 09:05
mike_bike_kite mike_bike_kite is offline
vaguely human
 
Join Date: Jun 2007
Location: London
Posts: 2,519
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.
Reply With Quote
  #5 (permalink)  
Old 03-14-09, 07:29
suresh_emmani suresh_emmani is offline
Registered User
 
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....
Reply With Quote
  #6 (permalink)  
Old 03-16-09, 03:34
dgreenhouse dgreenhouse is offline
Registered User
 
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....
Reply With Quote
  #7 (permalink)  
Old 03-16-09, 08:02
mike_bike_kite mike_bike_kite is offline
vaguely human
 
Join Date: Jun 2007
Location: London
Posts: 2,519
Quote:
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.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On