Using a trigger to send an Email [message #56857] |
Wed, 30 April 2003 16:19 |
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 |
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).
|
|
|
|
|
|