Home » SQL & PL/SQL » SQL & PL/SQL » sending email automatically from oracle (9.2.0.1.0)
sending email automatically from oracle [message #354066] Thu, 16 October 2008 05:55 Go to next message
suneelreddy
Messages: 11
Registered: May 2008
Location: india
Junior Member
Hello All,

Can we send a email automatically if a value in a table changes using SMTP?

For example

If a value of table t1 & column c1 changes .we need to send a mail automatically .


By using UTL_SMTP we can send a mail. but i am not sure whether we can send it automatically or not.PLs guide me or provide the links that cover about sending mails from oracle automatically.

Thanks in Advance,
Suneel Reddy.R
Re: sending email automatically from oracle [message #354070 is a reply to message #354066] Thu, 16 October 2008 06:11 Go to previous messageGo to next message
ThomasG
Messages: 3189
Registered: April 2005
Location: Heilbronn, Germany
Senior Member
Basically that could be done with a trigger and utl_mail or utl_smtp.

Two points to remember, though :

1) If you don't handle the errors that can happen, updates might become impossible because the mail server is down.

2) Are you really SURE you want so send a mail for every row that gets updated? How often do how many rows get updated?

[Updated on: Thu, 16 October 2008 06:12]

Report message to a moderator

Re: sending email automatically from oracle [message #354074 is a reply to message #354070] Thu, 16 October 2008 06:21 Go to previous messageGo to next message
suneelreddy
Messages: 11
Registered: May 2008
Location: india
Junior Member
Hi Thomas,

That table contains only one row .Updates are very rare for that coulumn.Let me say you the requirement that table stores the information of the application srv status.My requirement is to send a mail to support teams if primary application server is down.The application will run on secondary.My requirement is to send a mail to support teams that Appserver 1 is stopped.

This happens very rare approx once in a quarter or so.

But this is required as they have to change some schedulers if primary is down.

Is the requirement clear .
Any have i will study the links provided by you.

If you can help more .PLs.

Thanks for the reply

Regards
Suneel Reddy .R
Re: sending email automatically from oracle [message #354123 is a reply to message #354074] Thu, 16 October 2008 08:30 Go to previous message
ThomasG
Messages: 3189
Registered: April 2005
Location: Heilbronn, Germany
Senior Member
In that case it should work that way.

There are examples in the documentation, try them and post what you tried and the problem (the entire relevant SQL*Plus Session when applicable) in case you get stuck at some point.

Previous Topic: Using FORALL
Next Topic: Record to column display ...
Goto Forum:
  


Current Time: Wed Dec 07 16:40:01 CST 2016

Total time taken to generate the page: 0.28174 seconds