Re: Which to use: Trigger/Oracle Mail

From: Vipin Gokhale <vgokhale_at_us.oracle.com>
Date: Thu, 7 Oct 1993 01:29:17 GMT
Message-ID: <1993Oct7.012917.3972_at_oracle.us.oracle.com>


--
In article <28pnmm$s5o_at_snoopy.sra.com>, carmen_at_pni.sra.com (Carmen Iannacone) writes:

>From: carmen_at_pni.sra.com (Carmen Iannacone)
>Newsgroups: comp.databases.oracle
>Subject: Which to use: Trigger/Oracle Mail
>Reply-To: carmen_at_media.sra.com
>
>
> Hello everyone,
>
> I'd like to issue an email message to a user (who will
> *NOT* have Oracle, and will not be at my site...) containing
> all the fields of a row after an insert has been made
> into a table. Depending on a combination of the fields'
> states, a different user would be mailed. (i.e. given
> SUBJECT is a column, then if new.subject = "Accounting"
> mail Fred, if new.subject = "Receiving" mail Bertha...)
>
> My question is, is it possible to trigger an OS command
> via a database trigger? Is Oracle*Mail the tool I want
> to be using? (I have no experience at all with it, so
> I'm not sure what it does...).
>
> I'm using 7.0.13.1 on a Sun, and I don't see any "operating
> system command" based trigger stuff in the manuals. Can
> anyone suggest the "do-ability" of this, and recommend a
> path toward a solution?
>
> My thanks in advance for any help.
>
> -Carmen
>
>
>
> One last thought:
>
> There might be a "long way" around the problem by having a
> polling cron job look in a certain directory say, every
> five minutes, and dump all inserts into flat files there.
> This job would mail people based on what directory it
> was in. We'd still need a trigger (I guess) to write the
> rows into individual files though...
>
> Can a trigger ask the OS for a new file (as a C program
> might) and then write the fields to it? It strikes me
> that if it could do this, it could do the mailing, but
> perhaps the thought might click with someone...
>
>
>
>--
>------------------------------------------------------------------------
>Carmen Iannacone (703) 803-1544
>Associate Member of the Professional Staff 4300 Fair Lakes Court
>SRA Corporation Suite 250
>Fairfax, Virginia Fairfax, Va. 22033
>
>
You can always have the trigger insert a "log" record in another table and have a program written in some 3GL - say Pro*C, select from this table, contruct the mail message, send it off to people, whatever else you wish to do. Once this "daemon" program sends a message, it goes back and deletes the record from "log" table. Vipin-
Received on Thu Oct 07 1993 - 02:29:17 CET

Original text of this message