| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: external procedure from trigger?
why use a trigger?
seems like better design if you write a PL/SQL
package to contain all logic and encapsulate
the error log table completely.
might be better for degugging too.
In article <378DFCD1.2FFFD0CE_at_bigfoot.com>,
Doug Cowles <dcowles_at_bigfoot.com> wrote:
> That's an interesting idea. Can I ask how the job itself sends e-
mail?
> Do you use an extproc?
> Dc.
>
> Christopher Beck wrote:
>
> > 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.
> >
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
Received on Sat Jul 24 1999 - 11:30:17 CDT
![]() |
![]() |