Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

tutorial for creating a trigger in MySQL

Status
Not open for further replies.

lhugh

MIS
May 21, 2000
115
CA
does anybody know where I can find a tutorial on creating trigger in MySQL

I have a fied called expiry_date, I want to create a trigger on this field and that if the current date is a month prior to expiry date, my database will send an email to remind the system admin to do something.

Where can I find some tutorial like that?

Thank you all for your help

 
Sorry, can't be done. According to the MySQL manual, triggers are planned for the future, but don't hold your breath.
 
could create a cron job to run a small script at night (or whenever) to run the same check and send the email.

PHP, ASP whatever...

Cat, the other other white meat
 
You could write a batch perl program that used a looping “sleep” command to pause, and then when the “sleep” was finished you could test for or set a trigger. If it was set you could send an e-mail or use the perl “system” command to start another thread that runs a batch sql script. I have done each of these things but not together. It is just a thought.

Good luck, let us know if you try it and it works.

Our thoughts are only good if they work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top