Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: external procedure from trigger?
On Wed, 14 Jul 1999 23:57:57 -0400, Doug Cowles <dcowles_at_bigfoot.com> wrote:
>I would like it if I can set up e-mail through a trigger, and therefore
>paging. I have an error table in a custom app and was hoping to be
>paged whenever there was a new
>record. (Paging is done through e-mail in my case). I thought an
>external
>procedure which called a shell function or os command would do the
>trick,
>but it occurred to me that since there's no dbms_sql allowed, there may
>be no external procedures allowed either in triggers. If this is true,
>any other ideas?
>I saw a posting ealier about mucking around on Oracle's website for help
>with e-mail.
>Possible in a trigger? I guess I'm just thinking that if there is some
>sort of theoretical
>problem with committing in a trigger, it might be a problem to interface
>with the outside
>world as well.
Nope, you can call extprocs from triggers.
The way I send mail from a trigger is to have the trigger schedule a database job using dbms_job. That way if after sending the mail I have to rollback for whatever reason, the job is dequeued and the mail is never sent. If you directly call the extproc from the trigger, there would be no way for you to rollback the sent mail since the processing of the extproc is independent of the database transaction.
hope this helps.
chris.
>
>- Dc.
--
Christopher Beck
Oracle Corporation
clbeck_at_us.oracle.com
Reston, VA.
![]() |
![]() |