0

I have a table that records positions (gps) and fires insert trigger, where I check if new point is inside or outside of an area, based on the result I need to notify (send email or sms).

I am able detect from trigger that i need to send the notification but will like to be able to make a shell call or http to an url to call and send the email. something like http://myserver.com/sendemail.php?to=email@address.com&subject=New+Messaje&body=You+are+inside

If this is not posible how can be another / better approach.

Thanks

neavilag
  • 609
  • 1
  • 8
  • 20

1 Answers1

1

Database triggers are not the right place for this sort of application logic. The correct place for this logic is in your application, where you're inserting the data into the table. (Conveniently, your application is also much better situated to send mail than the database is.)

  • Thank you for your answer, your approach is correct but the fact is I know if I need to notify after trigger validation, is not always and data is not entered from a single place in the application, can come from DTS /ETL or from a load data infile or from a mobile device – neavilag Jul 07 '12 at 12:29