Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Sending Email notification with PLSQL

Re: Sending Email notification with PLSQL

From: Michael Santoianni <msanto_at_duke.edu>
Date: 1997/07/28
Message-ID: <33dd0940.419681890@news.duke.edu>#1/1

The original question was titled: Sending Email notification with PLSQL. You're "!" solution will only work with sqlplus, not with say Oracle WebServer running PLSQL directly. Your second solution should work although a more elagent solution would be to utilize the DBMS_PIPE package. You would create a UNIX daemon written in ProC that accesses messages created by the DBMS_PIPE package which was called by a stored procedure. This solution allows for paging on demand rather than on a polling schedule. I suspect it may even have a lighter footprint on the server's resources (only a guess).
If the original question did refer to the Web Server, there's got to be a way for it to execute external cgi-bin scripts (a guess again). This would allow you to execute a pager program from within the Web Server/PLSQL.

Michael Santoianni
DBA, Duke University

cnsltwlh_at_GeeTeeEee.net (William Hill) wrote:

>This assumes a Unix platform:
>
>You can also make the agent sqlplus driven by spooling the output
>of a select from the event table into a file. Then have an init
>spawned shell daemon which simply sleeps for a time, runs the
>plsql script to check the event table, and fires off email if the
>file exists and has a particular string in it - like HIT. This
>script then sends the mail and deletes the special file, then dies.
>Init will spawn a new instance once the old one dies and the
>process continues .... The shell script should loop back to sleep
>if there is no work to be done (file doesn't exist or doesn't
>contain the key word).
>
>GeeTeeEee.net == gte.net
>
>In article <5r28ha$fha$1_at_gte1.gte.net>, cnsltwlh_at_gte.net says...
>>
>>It has worked. I have done it interactively and in a script on Unix.
>>Not certain on other platforms, but seems likely that it would work.
>>It did take same tweeking to get it to work in a script ....
>>
>>The better way to do it is still the agent/table way. I will be
>>happy to provide ProC and C code examples on how to do such an
>>agent under Unix.
>>
>>William
>>
>>In article <5qulr0$kmr$1_at_Jupiter.SPARCO.Com>, cheema_at_Jupiter.SPARCO.Com
>>says...
>>>
>>>cnsltwlh_at_GeeTeeEee.net (William Hill) writes:
>>>
>>>>There isn't any reason that I can think of not to do it this
>>>>way. One easy way to accomplish it would be to use a bang (!)
>>>>system call to invoke a program which will send you the
>>>>message you need (if Unix, then sendmail would work).
>>>
>>>This will not work.
>>>
>>>________________________________________________________________________
 _
 __
>>>Mubashir Cheema cheema_at_sparco.com
>>http://cheema.sparco.com/
>>
>
Received on Mon Jul 28 1997 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US