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: Is there any way to Mail , when a new record is inserted.

Re: Is there any way to Mail , when a new record is inserted.

From: Guess? <Nobody_at_nowhere.com>
Date: 1998/01/21
Message-ID: <34C6C4AE.7C0E@nowhere.com>#1/1

Johnny Chopra wrote:
>
> Hi Everyone,
>
> I have a requirement that whenever a new record is inserted into a table
> for e.g. EMP, an e-mail message should be sent to a specific
> User for e.g. SCOTT.
>
> I tried to write a database trigger (After Insert on EMP) as below:
> CREATE OR REPLACE TRIGGER MAIL_NEW_EMP_TRIG
> AFTER INSERT
> ON EMP
> BEGIN
> HOST ('/home/scott/mail_new_emp.sh');
> END;
>
> This work fine when I run from sqlprompt
> SQL> HOST /home/scott/mail_new_emp.sh
>
> But It does not work from inside trigger.
> Is there any way to mail when a new record is inserted into a table.
>
> We running oracle 7.3.3 on NCR UNIX and client is windows 95.
>
> NOTE:
> ( mail_new_emp.sh is a UNIX script.
> The purpose of this script is to mail to the User SCOTT.)
>
> I will really appreciate all the help and efforts.
> Thanks in advance
>
> If you any solution, then
> Please E-mail me on.
> johnnyc_at_instinctoz.com.au
> OR
> johnnyc_at_curly.starnet.com.au
>
> --
> Johnny Chopra

You can not HOST out from PL*SQL. You may want to research ORACLE PIPES as a possible solution. Received on Wed Jan 21 1998 - 00:00:00 CST

Original text of this message

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