Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Email from Oracle
adam.lewandowski_at_ae.ge.com wrote:
>
> Is it possible to send an email message from Oracle? For example, when a
> given row is updated, an email is sent to an address given in a column of
> that row? Could triggers be used to accomplish this?
> We're using Oracle 7.3
> Thanks,
>
> Adam Lewandowski
> GE Aircraft Engines
> adam.lewandowski_at_ae.ge.com
>
> -------------------==== Posted via Deja News ====-----------------------
> http://www.dejanews.com/ Search, Read, Post to Usenet
You can do this via dbms_pipe if the messages are not too large. In any PL/SQL block (for example in a trigger) you can send a message into a dbms_pipe 'mailbox':
dbms_pipe.pack_message( mail_to); dbms_pipe.pack_message( subject); dbms_pipe.pack_message( message); dbms_pipe.send_message( 'MY_MAIL_PIPE');
On the other side of the pipe should be a simple listening process, for example a C/C++ program that uses the Oracle Pro*C precompiler.
EXEC SQL BEGIN
dbms_pipe.receive_message( 'MY_MAIL_PIPE');
dbms_pipe.unpack_message( ....
END-EXEC;
In this program you can call the Mail program of your Operating system
to send the message.
If you have large messages or attachments to send you must not send all
informations via the pipe. One possible way is to put that information
in an interface table and send in the PIPE only the key of the entry.
The
listening process can read the data from the table.
Regards.
Holger Heidenbluth
KeepTool Software
Dr. Jan Dieckmann, Rolf Grünewald, Holger Heidenbluth GbR
Berlin, Germany
keeptool_at_compuserve.com
http://ourworld.compuserve.com/homepages/keeptool
Received on Wed May 07 1997 - 00:00:00 CDT