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

Home -> Community -> Usenet -> c.d.o.server -> Re: external procedure from trigger?

Re: external procedure from trigger?

From: Christopher Beck <clbeck_at_us.oracle.com>
Date: Thu, 15 Jul 1999 13:16:07 GMT
Message-ID: <3794db58.79216887@inet16.us.oracle.com>


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.



Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Thu Jul 15 1999 - 08:16:07 CDT

Original text of this message

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