Home » RDBMS Server » Server Administration » Using a trigger to send an Email
Using a trigger to send an Email [message #56857] Wed, 30 April 2003 16:19 Go to next message
James Briar
Messages: 72
Registered: January 2002
Location: Morden (South London)
Member
I've written a trigger which sends Emails whenever fired. This trigger works ok but is slow due the mail_files procedure i inserted into the code. The command is mail_files(v_from,v_to,v_subject,v_mess). I set the variables before hand in the trigger etc. The mail_files procedure takes a few seconds or more to run. Is there any way to kick off this procedure as a separate process to enable the trigger to finish immediately. I'll be required to write more triggers that send out Emails in the future. We are running Oracle 8i on a Sun Solaris 8 unix system.
Re: Using a trigger to send an Email [message #56858 is a reply to message #56857] Wed, 30 April 2003 17:15 Go to previous messageGo to next message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
One recommended approach is to submit a job (via DBMS_JOB) in the trigger. This allows the trigger to avoid the overhead of the actual mail call and keeps your transactional integrity (if you rollback, the email won't be sent).

Re: Using a trigger to send an Email [message #56863 is a reply to message #56858] Thu, 01 May 2003 01:33 Go to previous messageGo to next message
James Briar
Messages: 72
Registered: January 2002
Location: Morden (South London)
Member
Thanks very much for your reply Todd. I'll try this out.
Re: Using a trigger to send an Email [message #56875 is a reply to message #56858] Fri, 02 May 2003 00:37 Go to previous messageGo to next message
Trifon Anguelov
Messages: 514
Registered: June 2002
Senior Member
Here are two more links for How to send e-mail from Oracle PL/SQL - Click here and Click here

Hope that helps,

clio_usa
OCP - DBA

Visit our Web site

Re: Using a trigger to send an Email [message #56881 is a reply to message #56875] Fri, 02 May 2003 08:48 Go to previous message
James Briar
Messages: 72
Registered: January 2002
Location: Morden (South London)
Member
Thanks Trifon.
Previous Topic: Drive Oracle
Next Topic: lost tab table !!!!!!!!!!!!!!!!
Goto Forum:
  


Current Time: Mon Dec 30 15:39:44 CST 2024